FROM ubuntu:16.04
VOLUME ["/root/share1","/root/share2"]
docker build -f ./dockerfile -t ubuntu-volume-test:16.04 .
docker inspect 之后的结果,容器内的share1,share2创建完成,可是我的机器的目录竟然没有创建,Volumes字段是空的
"Config": {
"Hostname": "53f0d054bf0b",
"Domainname": "",
"User": "",
"AttachStdin": true,
"AttachStdout": true,
"AttachStderr": true,
"Tty": true,
"OpenStdin": true,
"StdinOnce": true,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/sh",
"-c",
"/bin/bash"
],
"Image": "ubuntu-volume-test:16.04",
"Volumes": {
"/root/share1": {},
"/root/share2": {}
},
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {}
},
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…