New to Docker and been checking through the docs, but seems as though this is a reasonable first go at a Dockerfile.
I'm running the following Dockerfile, but am encountering a bit of an issue:
FROM iojs:onbuild
COPY ../../webserver/includes/masterconfig.js ../../webserver/includes/masterconfig.js
This is probably a rookie mistake, but your help is appreciated :)
docker build -t nearby-pushes .
Sending build context to Docker daemon 9.728 kB
Sending build context to Docker daemon
Step 0 : FROM iojs:onbuild
# Executing 3 build triggers
Trigger 0, COPY package.json /usr/src/app/
Step 0 : COPY package.json /usr/src/app/
---> Using cache
Trigger 1, RUN npm install
Step 0 : RUN npm install
---> Using cache
Trigger 2, COPY . /usr/src/app
Step 0 : COPY . /usr/src/app
---> 5f4c87e2362c
Removing intermediate container 16a8fb4b4be1
Step 1 : COPY ../../webserver/includes/masterconfig.js ../../webserver/includes/masterconfig.js
INFO[0010] ../../webserver/includes/masterconfig.js: no such file or directory
The
ADD
andCOPY
directives cannot see files which are in parent directories. In other words, you cannot use them with a file path starting with../
.From the Docker documentation:
and
The important words are context of the build. From the docker build documentation: