|
| 1 | +# SPDX-License-Identifier: MIT |
| 2 | + |
| 3 | +# Copyright (c) 2025 SUSE LLC |
| 4 | + |
| 5 | +# All modifications and additions to the file contributed by third parties |
| 6 | +# remain the property of their copyright owners, unless otherwise agreed |
| 7 | +# upon. |
| 8 | + |
| 9 | +# The content of THIS FILE IS AUTOGENERATED and should not be manually modified. |
| 10 | +# It is maintained by the BCI team and generated by |
| 11 | +# https://github.com/SUSE/BCI-dockerfile-generator |
| 12 | + |
| 13 | +# Please submit bugfixes or comments via https://bugs.opensuse.org/ |
| 14 | +# You can contact the BCI team via https://github.com/SUSE/bci/discussions |
| 15 | + |
| 16 | +#!UseOBSRepositories |
| 17 | + |
| 18 | +#!BuildTag: suse/bind:9-%RELEASE% |
| 19 | +#!BuildTag: suse/bind:9 |
| 20 | +#!BuildTag: suse/bind:%%bind_major_minor%% |
| 21 | +#!BuildTag: suse/bind:%%bind_major_minor_patch%% |
| 22 | +#!BuildName: suse-bind-9 |
| 23 | +#!BuildVersion: 15.7.9 |
| 24 | +FROM suse/sle15:15.7 |
| 25 | + |
| 26 | +RUN set -euo pipefail; \ |
| 27 | + zypper -n install --no-recommends bind; \ |
| 28 | + zypper -n clean; \ |
| 29 | + rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2} |
| 30 | + |
| 31 | +# Define labels according to https://en.opensuse.org/Building_derived_containers |
| 32 | +# labelprefix=com.suse.application.bind |
| 33 | +LABEL org.opencontainers.image.authors="https://github.com/SUSE/bci/discussions" |
| 34 | +LABEL org.opencontainers.image.title="SLE ISC BIND 9" |
| 35 | +LABEL org.opencontainers.image.description="ISC BIND 9 container based on the SLE Base Container Image." |
| 36 | +LABEL org.opencontainers.image.version="9" |
| 37 | +LABEL org.opencontainers.image.url="https://www.suse.com/products/base-container-images/" |
| 38 | +LABEL org.opencontainers.image.created="%BUILDTIME%" |
| 39 | +LABEL org.opencontainers.image.vendor="SUSE LLC" |
| 40 | +LABEL org.opencontainers.image.source="%SOURCEURL%" |
| 41 | +LABEL org.opencontainers.image.ref.name="9-%RELEASE%" |
| 42 | +LABEL org.opensuse.reference="registry.suse.com/suse/bind:9-%RELEASE%" |
| 43 | +LABEL org.openbuildservice.disturl="%DISTURL%" |
| 44 | +LABEL com.suse.supportlevel="techpreview" |
| 45 | +LABEL com.suse.eula="sle-eula" |
| 46 | +LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle#suse-linux-enterprise-server-15" |
| 47 | +LABEL com.suse.release-stage="beta" |
| 48 | +# endlabelprefix |
| 49 | +LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.md" |
| 50 | +ENV RNDC_KEYSIZE="512" |
| 51 | +ENV NAMED_ARGS="" |
| 52 | +ENV NAMED_INITIALIZE_SCRIPTS="" |
| 53 | +ENV NAMED_CONF="/etc/named.conf" |
| 54 | + |
| 55 | +EXPOSE 53/tcp 53/udp 953/tcp 853/tcp 443/tcp |
| 56 | +COPY entrypoint.sh /usr/local/bin/entrypoint.sh |
| 57 | +COPY healthcheck.sh /usr/local/bin/healthcheck.sh |
| 58 | +RUN set -euo pipefail; \ |
| 59 | + chmod +x /usr/local/bin/entrypoint.sh; \ |
| 60 | + chmod +x /usr/local/bin/healthcheck.sh; |
| 61 | + |
| 62 | +# patch named.prep to not call logger (provided by systemd) |
| 63 | +# and just log to stdout |
| 64 | +RUN set -euo pipefail; \ |
| 65 | + mkdir -p /usr/local/lib/bind; \ |
| 66 | + cp /usr/lib/bind/named.prep /usr/local/lib/bind/named.prep; \ |
| 67 | + sed -i -e 's|logger "Warning: \$1"|echo "Warning: \$1" >\&2|' -e '/\. \$SYSCONFIG_FILE/d' /usr/local/lib/bind/named.prep |
| 68 | + |
| 69 | +# create directories that tmpfiles.d would create for us |
| 70 | +RUN set -euo pipefail; \ |
| 71 | + mkdir -p /run/named; chown root:named /run/named; chmod 1775 /run/named; \ |
| 72 | + mkdir -p /var/lib/named; chown root:named /var/lib/named; chmod 1775 /var/lib/named; \ |
| 73 | + mkdir -p /var/lib/named/dyn; chown named:named /var/lib/named/dyn; chmod 755 /var/lib/named/dyn; \ |
| 74 | + mkdir -p /var/lib/named/master; chown named:named /var/lib/named/master; chmod 755 /var/lib/named/master; \ |
| 75 | + mkdir -p /var/lib/named/slave; chown named:named /var/lib/named/slave; chmod 755 /var/lib/named/slave; \ |
| 76 | + mkdir -p /var/log/named; chown named:named /var/log/named; chmod 750 /var/log/named; |
| 77 | +# create files that tmpfiles.d would create for us |
| 78 | +RUN set -euo pipefail; touch /var/lib/named/127.0.0.zone /var/lib/named/localhost.zone /var/lib/named/named.root.key /var/lib/named/root.hint |
| 79 | + |
| 80 | +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
| 81 | +HEALTHCHECK --interval=10s --timeout=5s --retries=10 CMD ["/usr/local/bin/healthcheck.sh"] |
| 82 | + |
0 commit comments