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?
Asked
Active
Viewed 71 times
2 Answers
1
Just create another docker image based your image.
FROM base-image-name
ADD host_dir /destination_dir

fabrizioM
- 46,639
- 15
- 102
- 119
-
1did you tag your image ? you need to put the tag name of your image to work – fabrizioM Aug 26 '14 at 23:20
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