How to write data to host file system from Docker container

From “Managing data in containers“, mounting a host folder to a container would be:

docker run -v /Users/<path>:/<container path>

(see “Use volume“)

Using only -v /usr/share/nginx/reports would declare the internal container path /usr/share/nginx/reports as a volume, but would have nothing to do with the host folder.

This is one of the type of mounts available:

https://docs.docker.com/storage/images/types-of-mounts.png

Leave a Comment