0

I have a docker image already. I want to be able to add a directory from the host file system to the docker filesystem. I know that if I am using a base image, I could use the ADD command in the dockerfile but I am not actually using a base image, I want to build a new docker image based on my image with some directories added to it from my host file system. Is there a way to do that?

Keeto
  • 4,074
  • 9
  • 35
  • 58

2 Answers2

1

Just create another docker image based your image.

FROM base-image-name

ADD host_dir  /destination_dir
fabrizioM
  • 46,639
  • 15
  • 102
  • 119
1

You do not need a new image, just run it like this:

docker run your_image -v host_dir:local_dir

Karl Forner
  • 4,175
  • 25
  • 32