2023-07-25 13:35:33 +00:00
# SPDX-License-Identifier: MIT
2023-09-28 15:03:35 +00:00
2026-01-01 14:23:06 +00:00
# Copyright (c) 2026 SUSE LLC
2023-09-28 15:03:35 +00:00
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon.
# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
# It is maintained by the BCI team and generated by
# https://github.com/SUSE/BCI-dockerfile-generator
# Please submit bugfixes or comments via https://bugs.opensuse.org/
# You can contact the BCI team via https://github.com/SUSE/bci/discussions
2024-09-12 10:44:15 +00:00
#!UseOBSRepositories
2023-09-28 15:03:35 +00:00
2025-06-30 15:23:33 +00:00
#!BuildTag: opensuse/nginx:1.29-%RELEASE%
#!BuildTag: opensuse/nginx:1.29
2023-07-25 13:35:33 +00:00
#!BuildTag: opensuse/nginx:latest
2025-11-25 11:56:34 +00:00
FROM opensuse/bci/bci-micro:latest AS target
FROM opensuse/tumbleweed:latest AS builder
COPY --from= target / /target
2023-07-25 13:35:33 +00:00
2024-09-25 17:57:11 +00:00
RUN set -euo pipefail; \
2025-11-25 11:56:34 +00:00
export PERMCTL_ALLOW_INSECURE_MODE_IF_NO_PROC = 1; \
2025-11-28 17:35:36 +00:00
zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends curl gawk nginx findutils envsubst
2025-11-25 11:56:34 +00:00
# sanity check that the version from the tag is equal to the version of nginx that we expect
RUN set -euo pipefail; \
[ " $( rpm --root /target -q --qf '%{version}' nginx | \
cut -d '.' -f -2) " = " 1.29" ]
2025-10-20 13:00:55 +00:00
# cleanup logs and temporary files
2025-11-25 11:56:34 +00:00
RUN set -euo pipefail; zypper -n --installroot /target clean -a; \
2025-09-29 09:35:55 +00:00
rm -rf { /target,} /var/log/{ alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2} ; \
rm -rf { /target,} /run/*; \
rm -f { /target,} /etc/{ shadow-,group-,passwd-,.pwd.lock} ; \
rm -f { /target,} /usr/lib/sysimage/rpm/.rpm.lock; \
rm -f { /target,} /var/cache/ldconfig/aux-cache; \
command -v zypper >/dev/null 2>& 1 || rm -f /var/lib/zypp/AutoInstalled
2025-10-20 13:00:55 +00:00
# set the day of last password change to empty
2025-11-25 11:56:34 +00:00
RUN set -euo pipefail; sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /target/etc/shadow
FROM opensuse/bci/bci-micro:latest
COPY --from= builder /target /
2023-07-25 13:35:33 +00:00
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=org.opensuse.application.nginx
LABEL org.opencontainers.image.title= "openSUSE Tumbleweed NGINX"
LABEL org.opencontainers.image.description= "NGINX open source all-in-one load balancer, content cache and web server based on the openSUSE Tumbleweed Base Container Image."
2025-06-30 15:23:33 +00:00
LABEL org.opencontainers.image.version= "1.29"
2023-07-25 13:35:33 +00:00
LABEL org.opencontainers.image.url= "https://www.opensuse.org"
LABEL org.opencontainers.image.created= "%BUILDTIME%"
LABEL org.opencontainers.image.vendor= "openSUSE Project"
LABEL org.opencontainers.image.source= "%SOURCEURL%"
2025-06-30 15:23:33 +00:00
LABEL org.opencontainers.image.ref.name= "1.29-%RELEASE%"
LABEL org.opensuse.reference= "registry.opensuse.org/opensuse/nginx:1.29-%RELEASE%"
2023-07-25 13:35:33 +00:00
LABEL org.openbuildservice.disturl= "%DISTURL%"
2024-07-31 12:10:06 +00:00
LABEL org.opensuse.lifecycle-url= "https://en.opensuse.org/Lifetime#openSUSE_BCI"
2023-07-25 13:35:33 +00:00
LABEL org.opensuse.release-stage= "released"
# endlabelprefix
2025-05-26 09:31:22 +00:00
LABEL io.artifacthub.package.readme-url= "%SOURCEURL_WITH(README.md)%"
2023-07-25 13:35:33 +00:00
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
CMD [ "nginx" , "-g" , "daemon off;" ]
2024-10-31 16:12:27 +00:00
EXPOSE 80/tcp
2025-11-25 11:56:34 +00:00
2023-07-25 13:35:33 +00:00
RUN set -euo pipefail; mkdir /docker-entrypoint.d
COPY [ 1-3] 0-*.sh /docker-entrypoint.d/
COPY docker-entrypoint.sh /usr/local/bin
COPY index.html /srv/www/htdocs/
RUN set -euo pipefail; chmod +x /docker-entrypoint.d/*.sh /usr/local/bin/docker-entrypoint.sh
2025-11-25 11:56:34 +00:00
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
2023-07-25 13:35:33 +00:00
STOPSIGNAL SIGQUIT