When I build docker-build it doesn't see the config file

The nginx.conf exists, but for some reason the docker does not see it, how to solve it?

FROM nginx
USER root
WORKDIR /D05/
COPY ./nginx/nginx.conf /etc/nginx/
COPY ./server.c /home/server.c
COPY ./start.sh /home/start.sh
RUN apt-get update && apt install -y gcc libfcgi-dev spawn-fcgi;
ENTRYPOINT [ "sh", "./start.sh" ]

Step 4/8 : COPY ./nginx/nginx.conf /etc/nginx/
COPY failed: file not found in build context or excluded by 

.dockerignore: stat nginx/nginx.conf: file does not exist

enter image description here what could be causing the problem? Sorry for my English

Upvotes: 0

Views: 398

Answers (1)

czende
czende

Reputation: 1083

Look to your terminal - it says that COPY failed: file not found. Fix your nginx.conf path in Dockerfile on the line 4 (you don't have nginx folder)

...
COPY ./nginx.conf /etc/nginx/
...

After that I would recommend to check your start.sh if nginx is set correctly to start.

Upvotes: 2

Related Questions