Skip to content
Myr

Improve Dockerfile: update base image and optimize image size (#2649)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Also, drop ineffectual flags from configure.

authored by itchyny · committed by GitHub · parent 12ce4e3 · Browse files · 2 files+31 added−53 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+31 added−53 removed

  • other:+31 added−53 removed

2 files+31 added−53 removed

modified:.github/workflows/ci.yml+4 added-8 removed
41 unmodified lines
42 sudo apt-get install -y automake autoconf43 - name: Build44 run: |45 autoreconf -i46 ./configure --disable-dependency-tracking \47 --disable-silent-rules \46 ./configure \47 --disable-docs \48 --disable-maintainer-mode \49 --disable-valgrind \50 --with-oniguruma=builtin \
43 unmodified lines
94 brew install autoconf automake libtool95 - name: Build96 run: |97 autoreconf -i99 ./configure --disable-dependency-tracking \100 --disable-silent-rules \98 ./configure \99 --disable-docs \100 --disable-maintainer-mode \101 --disable-valgrind \102 --with-oniguruma=builtin \
50 unmodified lines
153 - name: Build154 shell: msys2 {0}155 run: |156 autoreconf -i159 ./configure --disable-dependency-tracking \160 --disable-silent-rules \157 ./configure \158 --disable-docs \159 --disable-maintainer-mode \160 --disable-valgrind \161 --with-oniguruma=builtin \
37 unmodified lines
199 sudo apt-get install -y automake autoconf200 - name: Create dist201 run: |202 autoreconf -i206 ./configure --disable-dependency-tracking \207 --disable-silent-rules \203 ./configure \204 --disable-docs \205 --disable-maintainer-mode \206 --disable-valgrind \207 --with-oniguruma=builtin
38 unmodified lines
modified:Dockerfile+27 added-45 removed
1FROM debian:91FROM debian:12-slim AS builder23ENV DEBIAN_FRONTEND=noninteractive \4 DEBCONF_NONINTERACTIVE_SEEN=true \5 LC_ALL=C.UTF-8 \6 LANG=C.UTF-878RUN apt-get update \9 && apt-get install -y \10 build-essential \11 autoconf \12 libtool \13 git \14 && apt-get clean \15 && rm -rf /var/lib/apt/lists/*1617WORKDIR /app18COPY . /app19RUN autoreconf -i \20 && ./configure \21 --disable-docs \22 --disable-maintainer-mode \23 --disable-valgrind \24 --with-oniguruma=builtin \25 --enable-static \26 --enable-all-static \27 --prefix=/usr/local \28 && make -j$(nproc) \29 && make check \30 && make install-strip3110# get dependencies, build, and remove anything we don't need for running jq.11# valgrind seems to have trouble with pthreads TLS so it's off.32FROM scratch3313RUN apt-get update && \14 apt-get install -y \15 build-essential \16 autoconf \17 libtool \18 git \19 bison \20 flex \21 python3 \22 python3-pip \23 wget && \24 pip3 install pipenv && \25 (cd /app/docs && pipenv sync) && \26 (cd /app && \27 git submodule init && \28 git submodule update && \29 autoreconf -i && \30 ./configure --disable-valgrind --enable-all-static --prefix=/usr/local && \31 make -j8 && \32 make check && \33 make install ) && \34 (cd /app/modules/oniguruma && \35 make uninstall ) && \36 (cd /app && \37 make distclean ) && \38 apt-get purge -y \39 build-essential \40 autoconf \41 libtool \42 bison \43 git \44 flex \45 python3 \46 python3-pip && \47 apt-get autoremove -y && \48 rm -rf /app/modules/oniguruma/* && \49 rm -rf /app/modules/oniguruma/.git && \50 rm -rf /app/modules/oniguruma/.gitignore && \51 rm -rf /var/lib/apt/lists/* /var/lib/gems5253ENTRYPOINT ["/usr/local/bin/jq"]54CMD []34COPY --from=builder /app/AUTHORS /app/COPYING /usr/local/bin/jq /35RUN ["/jq", "--version"]36ENTRYPOINT ["/jq"]