Mounting a single file from a Docker data volume in a Docker

只愿长相守 提交于 2019-12-01 17:22:18

Is there a way always destination path/file doesn't exist in the container, if you've created a named volume and a bind to its directory (similar to deprecated volumes_from)

docker run -v /var/lib/docker/volumes/my_volume/_data/MY_FILE.txt:/destination_folder/MY_FILE.txt

That's why when you create a named volume and run a service/container with docker run -v my_volume:/root/volume my_container, data is stored in /var/lib/docker/volumes/my_volume/_data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!