Keeto
Keeto

Reputation: 4208

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?

Upvotes: 0

Views: 79

Answers (2)

Karl Forner
Karl Forner

Reputation: 4414

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

docker run your_image -v host_dir:local_dir

Upvotes: 1

fabmilo
fabmilo

Reputation: 48330

Just create another docker image based your image.

FROM base-image-name

ADD host_dir  /destination_dir

Upvotes: 1

Related Questions