1919# !BuildTag: opensuse/nginx:1.29
2020# !BuildTag: opensuse/nginx:latest
2121
22- FROM opensuse/tumbleweed:latest
22+ FROM opensuse/bci/bci-micro:latest AS target
23+ FROM opensuse/tumbleweed:latest AS builder
24+ COPY --from=target / /target
2325
2426RUN set -euo pipefail; \
25- zypper -n install --no-recommends gawk nginx findutils envsubst
27+ export PERMCTL_ALLOW_INSECURE_MODE_IF_NO_PROC=1; \
28+ zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends gawk nginx findutils envsubst
29+ # sanity check that the version from the tag is equal to the version of nginx that we expect
30+ RUN set -euo pipefail; \
31+ [ "$(rpm --root /target -q --qf '%{version}' nginx | \
32+ cut -d '.' -f -2)" = "1.29" ]
2633
2734# cleanup logs and temporary files
28- RUN set -euo pipefail; zypper -n clean -a; \
35+ RUN set -euo pipefail; zypper -n --installroot /target clean -a; \
2936 rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
3037 rm -rf {/target,}/run/*; \
3138 rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
@@ -34,8 +41,9 @@ RUN set -euo pipefail; zypper -n clean -a; \
3441 command -v zypper >/dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled
3542
3643# set the day of last password change to empty
37- RUN set -euo pipefail; sed -i 's/^\( [^:]*:[^:]*:\) [^:]*\( :.*\) $/\1\2 /' /etc/shadow
38-
44+ RUN set -euo pipefail; sed -i 's/^\( [^:]*:[^:]*:\) [^:]*\( :.*\) $/\1\2 /' /target/etc/shadow
45+ FROM opensuse/bci/bci-micro:latest
46+ COPY --from=builder /target /
3947# Define labels according to https://en.opensuse.org/Building_derived_containers
4048# labelprefix=org.opensuse.application.nginx
4149LABEL org.opencontainers.image.title="openSUSE Tumbleweed NGINX"
@@ -55,15 +63,11 @@ LABEL io.artifacthub.package.readme-url="%SOURCEURL_WITH(README.md)%"
5563ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh" ]
5664CMD ["nginx" , "-g" , "daemon off;" ]
5765EXPOSE 80/tcp
58- # sanity check that the version from the tag is equal to the version of nginx that we expect
59- RUN set -euo pipefail; \
60- [ "$(rpm -q --qf '%{version}' nginx | \
61- cut -d '.' -f -2)" = "1.29" ]
66+
6267RUN set -euo pipefail; mkdir /docker-entrypoint.d
6368COPY [1-3]0-*.sh /docker-entrypoint.d/
6469COPY docker-entrypoint.sh /usr/local/bin
6570COPY index.html /srv/www/htdocs/
6671RUN set -euo pipefail; chmod +x /docker-entrypoint.d/*.sh /usr/local/bin/docker-entrypoint.sh
67- RUN set -euo pipefail; install -d -o nginx -g nginx -m 750 /var/log/nginx; ln -sf /dev/stdout /var/log/nginx/access.log; ln -sf /dev/stderr /var/log/nginx/error.log
68-
72+ RUN set -euo pipefail; install -d -o nginx -g nginx -m 750 /var/log/nginx; ln -sf /dev/stdout /var/log/nginx/access.log; ln -sf /dev/stderr /var/log/nginx/error.log
6973STOPSIGNAL SIGQUIT
0 commit comments