mirror of
https://github.com/11notes/docker-bind.git
synced 2025-11-14 10:25:41 +00:00
update to 9.18.13
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# :: Header
|
# :: Header
|
||||||
FROM alpine:3.16
|
FROM alpine:latest
|
||||||
|
ENV binVersion=9.18.13-r0
|
||||||
|
|
||||||
# :: Run
|
# :: Run
|
||||||
USER root
|
USER root
|
||||||
@@ -10,12 +11,15 @@
|
|||||||
mkdir -p /bind/etc \
|
mkdir -p /bind/etc \
|
||||||
mkdir -p /bind/var;
|
mkdir -p /bind/var;
|
||||||
|
|
||||||
|
# :: install
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apk add --update --no-cache \
|
apk add --update --no-cache \
|
||||||
bash \
|
bash \
|
||||||
bind>=9.16.29 \
|
bind>=${binVersion} \
|
||||||
|
bind-tools \
|
||||||
shadow;
|
shadow;
|
||||||
|
|
||||||
|
# :: configure
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
addgroup --gid 1000 -S bind; \
|
addgroup --gid 1000 -S bind; \
|
||||||
adduser --uid 1000 -D -S -h /bind -s /sbin/nologin -G bind bind;
|
adduser --uid 1000 -D -S -h /bind -s /sbin/nologin -G bind bind;
|
||||||
@@ -29,13 +33,14 @@
|
|||||||
/bind \
|
/bind \
|
||||||
/var/run/named;
|
/var/run/named;
|
||||||
|
|
||||||
# :: Version
|
|
||||||
RUN set -ex; \
|
|
||||||
echo "CI/CD{{$(named -v 2>&1)}}";
|
|
||||||
|
|
||||||
# :: Volumes
|
# :: Volumes
|
||||||
VOLUME ["/bind/etc", "/bind/var"]
|
VOLUME ["/bind/etc", "/bind/var"]
|
||||||
|
|
||||||
|
# :: Monitor
|
||||||
|
RUN set -ex; chmod +x /usr/local/bin/healthcheck.sh
|
||||||
|
HEALTHCHECK CMD /usr/local/bin/healthcheck.sh || exit 1
|
||||||
|
|
||||||
# :: Start
|
# :: Start
|
||||||
|
RUN set -ex; chmod +x /usr/local/bin/entrypoint.sh
|
||||||
USER bind
|
USER bind
|
||||||
CMD ["/usr/sbin/named", "-fg", "-c", "/bind/etc/named.conf", "-u", "bind"]
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
@@ -9,6 +9,8 @@ options {
|
|||||||
max-cache-size 256m;
|
max-cache-size 256m;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
server ::/0 { bogus yes; };
|
||||||
|
|
||||||
acl acl-internal {
|
acl acl-internal {
|
||||||
10.0.0.0/8;
|
10.0.0.0/8;
|
||||||
172.16.0.0/12;
|
172.16.0.0/12;
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
view "internal" {
|
view "internal" {
|
||||||
|
recursion yes;
|
||||||
match-clients { acl-internal; };
|
match-clients { acl-internal; };
|
||||||
allow-query { acl-internal; };
|
allow-query { acl-internal; };
|
||||||
recursion yes;
|
allow-recursion { acl-internal; };
|
||||||
|
zone "." { type hint; file "/bind/var/root.db"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
view "external" {
|
view "external" {
|
||||||
|
|||||||
9
rootfs/usr/local/bin/entrypoint.sh
Normal file
9
rootfs/usr/local/bin/entrypoint.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/ash
|
||||||
|
if [ -z "${1}" ]; then
|
||||||
|
set -- "named" \
|
||||||
|
-fg \
|
||||||
|
-c "/bind/etc/named.conf" \
|
||||||
|
-u bind
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
2
rootfs/usr/local/bin/healthcheck.sh
Normal file
2
rootfs/usr/local/bin/healthcheck.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/ash
|
||||||
|
dig . NS @localhost || exit 1
|
||||||
Reference in New Issue
Block a user