DockerFile
Dockerfile 就是用来构建 docker 镜像的构建文件!命令脚本!先体验一下!
通过这个脚本可以生成镜像,镜像是一层一层的,脚本一个个的命令,每个命令都是一层!
FROM centos
VOLUME ["/volume01", "/volume02"]
CMD "------end------"
CMD /bin/bash
[root@xoste home]
[root@xoste home]
docker-test-volume mysql test
[root@xoste home]
[root@xoste docker-test-volume]
[root@xoste docker-test-volume]
FROM centos
VOLUME ["/volume01", "/volume02"]
CMD "------end------"
CMD /bin/bash
[root@xoste docker-test-volume]
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /dockerfile01: no such file or directory
[root@xoste docker-test-volume]
Step 1/4 : FROM centos
---> 300e315adb2f
Step 2/4 : VOLUME ["/volume01", "/volume02"]
---> Running in 067d03530634
Removing intermediate container 067d03530634
---> 0f7d75da2074
Step 3/4 : CMD echo "------end------"
---> Running in e1378a3a50ea
Removing intermediate container e1378a3a50ea
---> 53874b5bae6b
Step 4/4 : CMD /bin/bash
---> Running in e6e51124430d
Removing intermediate container e6e51124430d
---> 2c122ef1b148
Successfully built 2c122ef1b148
Successfully tagged xoste/centos:latest
运行测试成功
这个卷和外部一定有一个同步目录!
查看是否能同步!
|