Mounting a volume from the host into a Docker container

Assuming you have a folder called /data that you want to mount and access within a Docker container, you can so this a couple of ways, but the easiest is to specify when you start the container as a bind mount, with:

docker run –volume /host-path:/container-path:[rw|ro] imagename –volume

More info and options in the docs here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.