Reputation: 12044
I have my server running apache on port 80 and a docker images running on that server as well. I want to HTTP publish/map the content of /var/www/ from my docker to /var/www/docker on my real server
So when I run http://myserver/content it fetches the content on my docker /var/www
Is there a way to do that ?
Upvotes: 1
Views: 3342
Reputation: 13260
When you run your docker image, mount a volume by adding this flag:
docker run ... -v /var/www/docker:/var/www ... <Your image name>
This way, the contents of the /var/www/docker
folder in your host will be available in the /var/www
folder inside your container.
Upvotes: 0
Reputation: 1897
That is what volumes are for. With a volume a path inside of the container is mounted/bound on a path outside of the container. This allows both domains to access the files in that file system subtree.
To do what you describe (have /var/www/docker/
on the host be the same as /var/www/
in the container) you would call docker like this:
docker run [...] -v /var/www/docker:/var/www [image-name]
Upvotes: 1