挂载主机目录
挂载一个主机目录作为数据卷
$ docker run -d -P \
--name web \
# -v /src/webapp:/opt/webapp \
--mount type=bind,source=/src/webapp,target=/opt/webapp \
training/webapp \
python app.py$ docker run -d -P \
--name web \
# -v /src/webapp:/opt/webapp:ro \
--mount type=bind,source=/src/webapp,target=/opt/webapp,readonly \
training/webapp \
python app.py/opt/webapp # touch new.txt
touch: new.txt: Read-only file system查看数据卷的具体信息
挂载一个本地主机文件作为数据卷
Last updated