Docker Community Forums

Share and learn in the Docker community.

Loading configuration: permission denied

Hi everyone,

I have a little problem with my container here

I explain :

My image is built from github directly thanks t the Dockerfile :

FROM ubuntu

RUN apt-get update \
	&& apt-get install -y bind9 \
	&& apt-get install -y dnsutils \
	&& apt-get install -y vim 

ADD https://github.com/fshatskiy/ProjetAdminSys-R-seaux/tree/master/DNS/Config/db.wt20.ephec-ti.be /etc/bind/
ADD https://github.com/fshatskiy/ProjetAdminSys-R-seaux/tree/master/DNS/Config/named.conf.local /etc/bind/
ADD https://github.com/fshatskiy/ProjetAdminSys-R-seaux/tree/master/DNS/Config/named.conf.default-zones /etc/bind/
ADD https://github.com/fshatskiy/ProjetAdminSys-R-seaux/tree/master/DNS/Config/named.conf.options /etc/bind/

WORKDIR /etc/bind

VOLUME /etc/bind

EXPOSE 53/udp 53/tcp

CMD ["usr/sbin/named"] 

And when i Run it to get the container with this command :

sudo docker run -d -p 53:53 --name=latestBindv1 adminprojet/admin_projet_repo:latest

“latest” because the build created is named “latest” on my dockerhub,

I get this error message in the “docker logs container” :

25-Mar-2019 15:31:26.093 running as: named -g -c /etc/bind/named.conf -u bind
25-Mar-2019 15:31:26.093 ----------------------------------------------------
25-Mar-2019 15:31:26.093 BIND 9 is maintained by Internet Systems Consortium,
25-Mar-2019 15:31:26.093 Inc. (ISC), a non-profit 501(c)(3) public-benefit 
25-Mar-2019 15:31:26.093 corporation.  Support and training for BIND 9 are 
25-Mar-2019 15:31:26.093 available at https://www.isc.org/support
25-Mar-2019 15:31:26.093 ----------------------------------------------------
25-Mar-2019 15:31:26.093 found 1 CPU, using 1 worker thread
25-Mar-2019 15:31:26.093 using 1 UDP listener per interface
25-Mar-2019 15:31:26.093 using up to 4096 sockets
25-Mar-2019 15:31:26.099 loading configuration from '/etc/bind/named.conf'
25-Mar-2019 15:31:26.099 /etc/bind/named.conf:9: open: /etc/bind/named.conf.options: permission denied
25-Mar-2019 15:31:26.099 loading configuration: permission denied
25-Mar-2019 15:31:26.100 exiting (due to fatal error)

I already tried by writing “RUN chmod /etc/bind/*” in the Dockerfile AND with “–privileged” clause but nothing change.

If anyone could help me plsease…

Thanks