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
Provenance
- Commit
2270e20- Tree
28bdba5- Author
itchyny <itchyny@cybozu.co.jp>- Committer
GitHub <noreply@github.com>- Parent
12ce4e3
2 files changed+31 added−53 removed
modified:.github/workflows/ci.yml+4 added-8 removed
41 unmodified lines42 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 lines94 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 lines153 - 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 lines199 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=builtin38 unmodified linesmodified:Dockerfile+27 added-45 removed
1-FROM debian:91+FROM debian:12-slim AS builder2 3 ENV DEBIAN_FRONTEND=noninteractive \4 DEBCONF_NONINTERACTIVE_SEEN=true \5 LC_ALL=C.UTF-8 \6 LANG=C.UTF-87 8+RUN 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/*16+17+WORKDIR /app18 COPY . /app19+RUN 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-strip31 10-# 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.32+FROM scratch33 13-RUN 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/gems52-53-ENTRYPOINT ["/usr/local/bin/jq"]54-CMD []34+COPY --from=builder /app/AUTHORS /app/COPYING /usr/local/bin/jq /35+RUN ["/jq", "--version"]36+ENTRYPOINT ["/jq"]