Search code examples
virtualizationdockerdockerhub

Adding a directory from the host filesystem to the docker filesystem (not in a dockerfile)


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?


Solution

  • Just create another docker image based your image.

    FROM base-image-name
    
    ADD host_dir  /destination_dir