1919# !BuildTag: suse/nginx:1.27
2020# !BuildName: suse-nginx-1.27
2121# !BuildVersion: 16.0.1.27
22- FROM registry.suse.com/bci/bci-base:16.0
22+ FROM registry.suse.com/bci/bci-micro:16.0 AS target
23+ FROM bci/bci-base:16.0 AS builder
24+ COPY --from=target / /target
2325
2426RUN set -euo pipefail; \
25- zypper -n install --no-recommends gawk nginx findutils gettext-runtime
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 gettext-runtime
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.27" ]
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 registry.suse.com/bci/bci-micro:16.0
46+ COPY --from=builder /target /
3947# Define labels according to https://en.opensuse.org/Building_derived_containers
4048# labelprefix=com.suse.application.nginx
4149LABEL org.opencontainers.image.authors="https://github.com/SUSE/bci/discussions"
@@ -60,15 +68,11 @@ LABEL io.artifacthub.package.readme-url="%SOURCEURL_WITH(README.md)%"
6068ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh" ]
6169CMD ["nginx" , "-g" , "daemon off;" ]
6270EXPOSE 80/tcp
63- # sanity check that the version from the tag is equal to the version of nginx that we expect
64- RUN set -euo pipefail; \
65- [ "$(rpm -q --qf '%{version}' nginx | \
66- cut -d '.' -f -2)" = "1.27" ]
71+
6772RUN set -euo pipefail; mkdir /docker-entrypoint.d
6873COPY [1-3]0-*.sh /docker-entrypoint.d/
6974COPY docker-entrypoint.sh /usr/local/bin
7075COPY index.html /srv/www/htdocs/
7176RUN set -euo pipefail; chmod +x /docker-entrypoint.d/*.sh /usr/local/bin/docker-entrypoint.sh
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
73-
77+ 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
7478STOPSIGNAL SIGQUIT
0 commit comments