How to copy/add files in user's home directory in host to container's home directory? How to copy/add files in user's home directory in host to container's home directory? docker docker

How to copy/add files in user's home directory in host to container's home directory?


It has now been two years sice the question has been ask, but I want to cite to official documentation here which states the same as what @Sung-Jin Park already found out.

ADD obeys the following rules:

  • The path must be inside the context of the build; you cannot ADD ../something /something, because the first step of a docker build is to send the context directory (and subdirectories) to the docker daemon.

Dockerfile reference ADD


you can use the following:

WORKDIR /homeCOPY ${pwd}/my-file.txt .