Added an entry point to chown /var/cache/bind in run time, in case you are mounting over with a folder that is owned by root
This commit is contained in:
parent
642ec12fe6
commit
08a6019c24
13
Dockerfile
13
Dockerfile
|
@ -1,14 +1,14 @@
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
EXPOSE 53
|
||||||
|
|
||||||
RUN apk --update add bind
|
RUN apk --update add bind
|
||||||
|
|
||||||
RUN mkdir -m 0755 -p /var/run/named && chown root:named /var/run/named
|
RUN mkdir -m 0755 -p /var/run/named && chown -R root:named /var/run/named
|
||||||
|
|
||||||
# /var/cache/bind needs to be owned by "bind"
|
# /var/cache/bind needs to be owned by "bind"
|
||||||
# since we are mounting, do it manually
|
# since we are mounting, do it manually
|
||||||
# NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown
|
# NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown
|
||||||
RUN mkdir /var/cache/bind
|
RUN mkdir -m 0755 -p /var/cache/bind && touch /var/cache/bind/docker-init && chown -R named:named /var/cache/bind
|
||||||
RUN chown named:named /var/cache/bind
|
|
||||||
RUN chmod -R 0775 /var/cache/bind
|
|
||||||
|
|
||||||
# Mounts
|
# Mounts
|
||||||
# NOTE: Per Dockerfile manual -->
|
# NOTE: Per Dockerfile manual -->
|
||||||
|
@ -17,6 +17,5 @@ RUN chmod -R 0775 /var/cache/bind
|
||||||
VOLUME ["/etc/bind"]
|
VOLUME ["/etc/bind"]
|
||||||
VOLUME ["/var/cache/bind"]
|
VOLUME ["/var/cache/bind"]
|
||||||
|
|
||||||
EXPOSE 53
|
COPY entrypoint.sh /
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["/usr/sbin/named", "-c", "/etc/bind/named.conf", "-g", "-u", "named"]
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
chown -R named:named /var/cache/bind
|
||||||
|
/usr/sbin/named -c /etc/bind/named.conf -g -u named
|
Loading…
Reference in New Issue