Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update Docker image to debian 12 #2617

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
*.o
*.a
*.lo
*.la
*.lai
*.so
*.so.*
*.gcda
*.gcno
*.gcov
*~
.*.sw[a-p]
tags

jq
!tests/modules/lib/jq/
jq.1

# Generated source
src/builtin.inc
*.pc

# Autotools junk
.libs
.deps
.dirstamp
libtool
*.log
stamp-h1
config.log
config.status
autom4te.cache
INSTALL
Makefile
jq-*.tar.gz
configure
aclocal.m4
Makefile.in
version.h
.remake-version-h
config.cache
*.rpm
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
tests/*.trs

cscope.in.out
cscope.out
cscope.po.out
jq.dSYM

# Don't bust the build-cache on Dockerfile/.dockerignore/text only changes
Dockerfile*
.dockerignore
.github
.travis.yml
appveyor.yml
build/*
docs/
KEYS
# Used by make
!docs/content/manual/manual.yml

# Other scripts
compile-ios.sh
4 changes: 2 additions & 2 deletions .github/workflows/scanbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cflags: ''
steps:
- name: Clone repository
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Open Submodule(s)
run: |
git submodule update --init --recursive
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
cat test-suite.log
cat tests/*.log
- name: Upload Logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Scan-Build Reports
path: '/tmp/scan-build*/'
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: pipenv
- name: Install pipenv
run: pip install pipenv
Expand Down
54 changes: 18 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,54 +1,36 @@
FROM debian:9

ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8
FROM alpine:3.18 AS builder

COPY . /app

# get dependencies, build, and remove anything we don't need for running jq.
# valgrind seems to have trouble with pthreads TLS so it's off.

RUN apt-get update && \
apt-get install -y \
build-essential \
RUN apk update && \
apk add --no-cache --virtual .build-deps \
build-base \
autoconf \
automake \
libtool \
git \
bison \
flex \
python3 \
python3-pip \
wget && \
pip3 install pipenv && \
(cd /app/docs && pipenv sync) && \
flex && \
(cd /app && \
git submodule init && \
git submodule update && \
autoreconf -i && \
./configure --disable-valgrind --enable-all-static --prefix=/usr/local && \
git submodule update --init && \
autoreconf -if && \
./configure --disable-docs --enable-all-static CFLAGS='-Os -static -no-pie' --prefix=/usr/local && \
make -j8 && \
make check && \
make install ) && \
make install-strip ) && \
(cd /app/modules/oniguruma && \
make uninstall ) && \
(cd /app && \
make distclean ) && \
apt-get purge -y \
build-essential \
autoconf \
libtool \
bison \
git \
flex \
python3 \
python3-pip && \
apt-get autoremove -y && \
rm -rf /app/modules/oniguruma/* && \
rm -rf /app/modules/oniguruma/.git && \
rm -rf /app/modules/oniguruma/.gitignore && \
rm -rf /var/lib/apt/lists/* /var/lib/gems
apk del .build-deps && \
rm -rf /app/modules/oniguruma/{*,.git,.gitignore} && \
rm -rf /var/lib/gems

FROM scratch

COPY --from=builder /app/AUTHORS /app/COPYING /usr/local/bin/jq /

ENTRYPOINT ["/usr/local/bin/jq"]
ENTRYPOINT ["/jq"]
CMD []
47 changes: 47 additions & 0 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM debian:12-slim AS builder

ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8

COPY . /app

# get dependencies, build, and remove anything we don't need for running jq.

RUN apt update && \
apt install -y \
build-essential \
autoconf \
libtool \
git \
bison \
flex && \
(cd /app && \
git submodule update --init && \
autoreconf -if && \
./configure --disable-docs --enable-all-static CFLAGS='-Os -static -no-pie' --prefix=/usr/local && \
make -j8 && \
make check && \
make install-strip ) && \
(cd /app/modules/oniguruma && \
make uninstall ) && \
(cd /app && \
make distclean ) && \
apt purge -y \
build-essential \
autoconf \
libtool \
bison \
git \
flex && \
apt autoremove -y && \
rm -rf /app/modules/oniguruma/{*,.git,.gitignore} && \
rm -rf /var/lib/apt/lists/* /var/lib/gems

FROM scratch

COPY --from=builder /app/AUTHORS /app/COPYING /usr/local/bin/jq /

ENTRYPOINT ["/jq"]
CMD []
10 changes: 5 additions & 5 deletions docs/content/download/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ body:

### Linux

* jq 1.5 is in the official [Debian](https://packages.debian.org/jq) and
* jq 1.6 is in the official [Debian](https://packages.debian.org/jq) and
[Ubuntu](http://packages.ubuntu.com/jq) repositories. Install using
`sudo apt-get install jq`.

* jq 1.5 is in the official
* jq 1.6 is in the official
[Fedora](https://src.fedoraproject.org/rpms/jq) repository.
Install using `sudo dnf install jq`.

* jq 1.4 is in the official [openSUSE](https://software.opensuse.org/package/jq)
* jq 1.6 is in the official [openSUSE](https://software.opensuse.org/package/jq)
repository. Install using `sudo zypper install jq`.

* jq 1.5 is in the official
[Arch](https://www.archlinux.org/packages/?sort=&q=jq&maintainer=&flagged=)
* jq 1.6 is in the official
[Arch](https://archlinux.org/packages/?sort=&q=jq&maintainer=&flagged=)
repository. Install using `sudo pacman -S jq`.

* jq 1.6 binaries for
Expand Down
35 changes: 35 additions & 0 deletions tests/man.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
"Hello, world!"
"Hello, world!"

. | tojson
12345678909876543212345
"12345678909876543212345"

map([., . == 1]) | tojson
[1, 1.000, 1.0, 100e-2]
"[[1,true],[1.000,true],[1.0,true],[1.00,true]]"

. as $big | [$big, $big + 1] | map(. > 10000000000000000000000000000000)
10000000000000000000000000000001
[true, false]

.foo
{"foo": 42, "bar": "less interesting data"}
42
Expand Down Expand Up @@ -551,6 +563,10 @@ join(" ")
1
[1,2,4,8,16,32,64]

[repeat(.*2, error)?]
1
[2]

[.,1]|until(.[0] < 1; [.[0] - 1, .[1] * .[0]])|.[1]
4
24
Expand Down Expand Up @@ -841,8 +857,27 @@ true
{"foo": 42}
{"foo": 43}

.a = .b
{"a": {"b": 10}, "b": 20}
{"a":20,"b":20}

.a |= .b
{"a": {"b": 10}, "b": 20}
{"a":10,"b":20}

(.a, .b) = range(3)
null
{"a":0,"b":0}
{"a":1,"b":1}
{"a":2,"b":2}

(.a, .b) |= range(3)
null
{"a":0,"b":0}

.[]|tonumber?
["1", "hello", "3", 4]
1
3
4