Reputation: 6493
When building my Docker image I need to copy all of the files in the same directory in to the Docker image.
I attempted to do this
ADD ./* $HOME/src
RUN ls $HOME/src
but it doesn't seem to work
ls: cannot access /root/src: No such file or directory
How would I go about copying all of the current directory and subdirectories in to my docker image while building?
Upvotes: 38
Views: 89483
Reputation: 6493
I was building the images using docker build - < Dockerfile
which apparently doen't send the build context so things can't be copied. After changing to docker build .
and adding the / like MB11 suggested the build worked.
Upvotes: 23