dockerdee
(Dockerdee)
August 6, 2017, 10:44am
1
Hi
(New to Docker)
Im having an issue when trying to use a Docker file and run nginx.
The Issue:
Cannot copy files. I have created a basic Docker file, Im trying to get nginx running via the Docker file, but I get the below issue.
docker build .
Sending build context to Docker daemon 2.56kB
Step 1/2 : FROM nginx
---> b8efb18f159b
Step 2/2 : COPY /home/www/html/ /usr/share/nginx/html/
COPY failed: stat /var/lib/docker/tmp/docker-builder375485353/home/www/html: no such file or directory
OS Version/build:
CentOS Linux release 7.2.1511 (Core)
App version:
Docker version 17.06.0-ce, build 02c1d87
Docker Content:
FROM nginx
COPY /home/www/html/ /usr/share/nginx/html/
Any thoughs on this issue would be great
Dee
dockerdee
(Dockerdee)
August 6, 2017, 5:49pm
2
After searching I managed to find a thread which had a similar issue, and they said the way to get this working is by running the command in the location of the source files and not to use a full path in the Docker file.
FROM nginx
COPY ./index.htm /usr/share/nginx/html/
This then works