0

I'm creating a dockerfile and I have a copy command like this:

COPY foo.conf /root/.folder/foo.conf

Then I run the image like this:

docker run -t -i -v $PWD/data:/root/.folder

On my local machine I can see data, but without foo.conf, even inside my container the folder is empty. if I don't use the -v, I can find the foo.conf in my container.

monkeyUser
  • 4,301
  • 7
  • 46
  • 95
  • I'm not sure what the question is here? Does this help? https://stackoverflow.com/questions/25311613/docker-mounting-volumes-on-host – John Polo Nov 16 '22 at 22:09
  • 1
    Your copying a file into `/root/.folder`...and then masking that directory with the contents of `$PWD` when you run the container. That is, you are mounting `$PWD` on top of `/root/.folder` so that you are hiding any content that exists there on the container filesystem. – larsks Nov 16 '22 at 22:24

0 Answers0