Skip to content

Commit 31ce500

Browse files
committed
Regenerated Dockerfiles.
1 parent 45bfba0 commit 31ce500

12 files changed

+453
-37
lines changed

pkg/docker/Dockerfile.go1.20

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM golang:1.20-bullseye
22

3-
LABEL org.opencontainers.image.title="Unit"
3+
LABEL org.opencontainers.image.title="Unit (go1.20)"
44
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
55
LABEL org.opencontainers.image.url="https://unit.nginx.org"
66
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
@@ -13,6 +13,8 @@ RUN set -ex \
1313
&& apt-get update \
1414
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
1515
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
16+
&& mkdir -p /usr/src/unit \
17+
&& cd /usr/src/unit \
1618
&& hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
1719
&& cd unit \
1820
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
@@ -22,7 +24,9 @@ RUN set -ex \
2224
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
2325
--statedir=/var/lib/unit \
2426
--control=unix:/var/run/control.unit.sock \
27+
--runstatedir=/var/run \
2528
--pid=/var/run/unit.pid \
29+
--logdir=/var/log \
2630
--log=/var/log/unit.log \
2731
--tmpdir=/var/tmp \
2832
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
4145
&& make -j $NCPU unitd \
4246
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
4347
&& make clean \
48+
&& /bin/true \
4449
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
4550
&& ./configure go --go-path=$GOPATH \
4651
&& make -j $NCPU go-install-src libunit-install \
@@ -49,15 +54,15 @@ RUN set -ex \
4954
&& ./configure go --go-path=$GOPATH \
5055
&& make -j $NCPU go-install-src libunit-install \
5156
&& cd \
52-
&& rm -rf unit \
57+
&& rm -rf /usr/src/unit \
5358
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
5459
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
5560
done \
5661
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
5762
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
5863
&& /bin/true \
5964
&& mkdir -p /var/lib/unit/ \
60-
&& mkdir /docker-entrypoint.d/ \
65+
&& mkdir -p /docker-entrypoint.d/ \
6166
&& groupadd --gid 999 unit \
6267
&& useradd \
6368
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
6974
unit \
7075
&& apt-get update \
7176
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
72-
&& apt-get purge -y --auto-remove \
77+
&& apt-get purge -y --auto-remove build-essential \
7378
&& rm -rf /var/lib/apt/lists/* \
7479
&& rm -f /requirements.apt \
7580
&& ln -sf /dev/stdout /var/log/unit.log

pkg/docker/Dockerfile.go1.21

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
FROM golang:1.21-bullseye
2+
3+
LABEL org.opencontainers.image.title="Unit (go1.21)"
4+
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
5+
LABEL org.opencontainers.image.url="https://unit.nginx.org"
6+
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
7+
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
8+
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
9+
LABEL org.opencontainers.image.version="1.30.0"
10+
11+
RUN set -ex \
12+
&& savedAptMark="$(apt-mark showmanual)" \
13+
&& apt-get update \
14+
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
15+
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
16+
&& mkdir -p /usr/src/unit \
17+
&& cd /usr/src/unit \
18+
&& hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
19+
&& cd unit \
20+
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
21+
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
22+
&& CC_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_CFLAGS_MAINT_APPEND="-Wp,-D_FORTIFY_SOURCE=2 -fPIC" dpkg-buildflags --get CFLAGS)" \
23+
&& LD_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_LDFLAGS_MAINT_APPEND="-Wl,--as-needed -pie" dpkg-buildflags --get LDFLAGS)" \
24+
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
25+
--statedir=/var/lib/unit \
26+
--control=unix:/var/run/control.unit.sock \
27+
--runstatedir=/var/run \
28+
--pid=/var/run/unit.pid \
29+
--logdir=/var/log \
30+
--log=/var/log/unit.log \
31+
--tmpdir=/var/tmp \
32+
--user=unit \
33+
--group=unit \
34+
--openssl \
35+
--libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
36+
&& CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
37+
--njs" \
38+
&& make -j $NCPU -C pkg/contrib .njs \
39+
&& export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
40+
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
41+
&& make -j $NCPU unitd \
42+
&& install -pm755 build/sbin/unitd /usr/sbin/unitd-debug \
43+
&& make clean \
44+
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/modules \
45+
&& make -j $NCPU unitd \
46+
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
47+
&& make clean \
48+
&& /bin/true \
49+
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
50+
&& ./configure go --go-path=$GOPATH \
51+
&& make -j $NCPU go-install-src libunit-install \
52+
&& make clean \
53+
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
54+
&& ./configure go --go-path=$GOPATH \
55+
&& make -j $NCPU go-install-src libunit-install \
56+
&& cd \
57+
&& rm -rf /usr/src/unit \
58+
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
59+
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
60+
done \
61+
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
62+
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
63+
&& /bin/true \
64+
&& mkdir -p /var/lib/unit/ \
65+
&& mkdir -p /docker-entrypoint.d/ \
66+
&& groupadd --gid 999 unit \
67+
&& useradd \
68+
--uid 999 \
69+
--gid unit \
70+
--no-create-home \
71+
--home /nonexistent \
72+
--comment "unit user" \
73+
--shell /bin/false \
74+
unit \
75+
&& apt-get update \
76+
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
77+
&& apt-get purge -y --auto-remove build-essential \
78+
&& rm -rf /var/lib/apt/lists/* \
79+
&& rm -f /requirements.apt \
80+
&& ln -sf /dev/stdout /var/log/unit.log
81+
82+
COPY docker-entrypoint.sh /usr/local/bin/
83+
COPY welcome.* /usr/share/unit/welcome/
84+
85+
STOPSIGNAL SIGTERM
86+
87+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
88+
EXPOSE 80
89+
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]

pkg/docker/Dockerfile.jsc11

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM eclipse-temurin:11-jdk-jammy
22

3-
LABEL org.opencontainers.image.title="Unit"
3+
LABEL org.opencontainers.image.title="Unit (jsc11)"
44
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
55
LABEL org.opencontainers.image.url="https://unit.nginx.org"
66
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
@@ -13,6 +13,8 @@ RUN set -ex \
1313
&& apt-get update \
1414
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
1515
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
16+
&& mkdir -p /usr/src/unit \
17+
&& cd /usr/src/unit \
1618
&& hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
1719
&& cd unit \
1820
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
@@ -22,7 +24,9 @@ RUN set -ex \
2224
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
2325
--statedir=/var/lib/unit \
2426
--control=unix:/var/run/control.unit.sock \
27+
--runstatedir=/var/run \
2528
--pid=/var/run/unit.pid \
29+
--logdir=/var/log \
2630
--log=/var/log/unit.log \
2731
--tmpdir=/var/tmp \
2832
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
4145
&& make -j $NCPU unitd \
4246
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
4347
&& make clean \
48+
&& /bin/true \
4449
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
4550
&& ./configure java --jars=/usr/share/unit-jsc-common/ \
4651
&& make -j $NCPU java-shared-install java-install \
@@ -49,15 +54,15 @@ RUN set -ex \
4954
&& ./configure java --jars=/usr/share/unit-jsc-common/ \
5055
&& make -j $NCPU java-shared-install java-install \
5156
&& cd \
52-
&& rm -rf unit \
57+
&& rm -rf /usr/src/unit \
5358
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
5459
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
5560
done \
5661
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
5762
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
58-
&& /bin/true \
63+
&& rm -rf /root/.m2 \
5964
&& mkdir -p /var/lib/unit/ \
60-
&& mkdir /docker-entrypoint.d/ \
65+
&& mkdir -p /docker-entrypoint.d/ \
6166
&& groupadd --gid 999 unit \
6267
&& useradd \
6368
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
6974
unit \
7075
&& apt-get update \
7176
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
72-
&& apt-get purge -y --auto-remove \
77+
&& apt-get purge -y --auto-remove build-essential \
7378
&& rm -rf /var/lib/apt/lists/* \
7479
&& rm -f /requirements.apt \
7580
&& ln -sf /dev/stdout /var/log/unit.log

pkg/docker/Dockerfile.minimal

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM debian:bullseye-slim
22

3-
LABEL org.opencontainers.image.title="Unit"
3+
LABEL org.opencontainers.image.title="Unit (minimal)"
44
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
55
LABEL org.opencontainers.image.url="https://unit.nginx.org"
66
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
@@ -13,6 +13,8 @@ RUN set -ex \
1313
&& apt-get update \
1414
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
1515
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
16+
&& mkdir -p /usr/src/unit \
17+
&& cd /usr/src/unit \
1618
&& hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
1719
&& cd unit \
1820
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
@@ -22,7 +24,9 @@ RUN set -ex \
2224
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
2325
--statedir=/var/lib/unit \
2426
--control=unix:/var/run/control.unit.sock \
27+
--runstatedir=/var/run \
2528
--pid=/var/run/unit.pid \
29+
--logdir=/var/log \
2630
--log=/var/log/unit.log \
2731
--tmpdir=/var/tmp \
2832
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
4145
&& make -j $NCPU unitd \
4246
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
4347
&& make clean \
48+
&& /bin/true \
4449
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
4550
&& ./configure \
4651
&& make -j $NCPU version \
@@ -49,15 +54,15 @@ RUN set -ex \
4954
&& ./configure \
5055
&& make -j $NCPU version \
5156
&& cd \
52-
&& rm -rf unit \
57+
&& rm -rf /usr/src/unit \
5358
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
5459
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
5560
done \
5661
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
5762
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
5863
&& /bin/true \
5964
&& mkdir -p /var/lib/unit/ \
60-
&& mkdir /docker-entrypoint.d/ \
65+
&& mkdir -p /docker-entrypoint.d/ \
6166
&& groupadd --gid 999 unit \
6267
&& useradd \
6368
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
6974
unit \
7075
&& apt-get update \
7176
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
72-
&& apt-get purge -y --auto-remove \
77+
&& apt-get purge -y --auto-remove build-essential \
7378
&& rm -rf /var/lib/apt/lists/* \
7479
&& rm -f /requirements.apt \
7580
&& ln -sf /dev/stdout /var/log/unit.log

pkg/docker/Dockerfile.node18

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:18-bullseye
22

3-
LABEL org.opencontainers.image.title="Unit"
3+
LABEL org.opencontainers.image.title="Unit (node18)"
44
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
55
LABEL org.opencontainers.image.url="https://unit.nginx.org"
66
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
@@ -13,6 +13,8 @@ RUN set -ex \
1313
&& apt-get update \
1414
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
1515
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
16+
&& mkdir -p /usr/src/unit \
17+
&& cd /usr/src/unit \
1618
&& hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
1719
&& cd unit \
1820
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
@@ -22,7 +24,9 @@ RUN set -ex \
2224
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
2325
--statedir=/var/lib/unit \
2426
--control=unix:/var/run/control.unit.sock \
27+
--runstatedir=/var/run \
2528
--pid=/var/run/unit.pid \
29+
--logdir=/var/log \
2630
--log=/var/log/unit.log \
2731
--tmpdir=/var/tmp \
2832
--user=unit \
@@ -41,23 +45,24 @@ RUN set -ex \
4145
&& make -j $NCPU unitd \
4246
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
4347
&& make clean \
48+
&& npm -g install node-gyp \
4449
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
45-
&& ./configure nodejs --node-gyp=/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp \
50+
&& ./configure nodejs --node-gyp=/usr/local/bin/node-gyp \
4651
&& make -j $NCPU node node-install libunit-install \
4752
&& make clean \
4853
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
49-
&& ./configure nodejs --node-gyp=/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp \
54+
&& ./configure nodejs --node-gyp=/usr/local/bin/node-gyp \
5055
&& make -j $NCPU node node-install libunit-install \
5156
&& cd \
52-
&& rm -rf unit \
57+
&& rm -rf /usr/src/unit \
5358
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
5459
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
5560
done \
5661
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
5762
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
58-
&& /bin/true \
63+
&& rm -rf /root/.cache/ && rm -rf /root/.npm \
5964
&& mkdir -p /var/lib/unit/ \
60-
&& mkdir /docker-entrypoint.d/ \
65+
&& mkdir -p /docker-entrypoint.d/ \
6166
&& groupadd --gid 999 unit \
6267
&& useradd \
6368
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
6974
unit \
7075
&& apt-get update \
7176
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
72-
&& apt-get purge -y --auto-remove \
77+
&& apt-get purge -y --auto-remove build-essential \
7378
&& rm -rf /var/lib/apt/lists/* \
7479
&& rm -f /requirements.apt \
7580
&& ln -sf /dev/stdout /var/log/unit.log

0 commit comments

Comments
 (0)