docker挂载本地目录
所属分类 docker
浏览量 658
-v /PATH/hostdir:/PATH/DIR
默认 可读写
只读 ro
-v /PATH/hostdir:/PATH/DIR:ro
docker run --name docker_started -v /Users/dugang/tmp:/hosttmp -d -p 80:80 docker/getting-started
http://127.0.0.1/
docker ps -a
docker ps
docker exec -it docker_started /bin/sh
docker stop docker_started
docker rm docker_started
docker run --name docker_started -v /Users/dugang/tmp:/hosttmp:ro -d -p 80:80 docker/getting-started
cd /hosttmp
echo "hello3" > hello3.txt
/bin/sh: can't create hello3.txt: Read-only file system
使用busybox
docker pull busybox
docker images
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 3c19bafed223 4 weeks ago 1.41MB
docker run --name mybusybox -v /Users/dugang/tmp:/hosttmp -it busybox /bin/sh
上一篇
下一篇
联邦学习入门笔记
docker命令实战
docker run 和 docker start 的区别
机器学习一般流程
docker镜像导入导出
机器学习基础