How to write data to host file system from Docker container

后端 未结 2 1929
遇见更好的自我
遇见更好的自我 2020-12-24 05:06

I have a Docker container which is running some code and creating some HTML reports. I want these reports to be published into a specific directory on the host machine, i.e.

2条回答
  •  渐次进展
    2020-12-24 05:47

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

    docker run -v /Users/:/
    

    (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:

提交回复
热议问题