docker bind mount:不是目录

时间:2018-08-08 11:08:05

标签: linux docker mint

这在运行Docker version 17.05.0-ce的旧主机上运行,​​但是在运行Docker version 17.06.2-ce的当前计算机上却失败了:

docker run \
        --detach \
        --hostname dnsmasq.mine \
        --name dnsmasq \
        --restart always \
        --net host \
        --cap-add=NET_ADMIN \
        --volume /tmp/srv/dnsmasq/dnsmasq.conf:/etc/dnsmasq.conf \
        --volume /tmp/srv/dnsmasq/dnsmasq.d:/etc/dnsmasq.d \
        --volume /tmp/srv/dnsmasq/hosts:/etc/hosts \
        andyshinn/dnsmasq:2.78 \
        --log-facility=- \
        --log-queries=extra \
        --all-servers \
        --conf-file=/etc/dnsmasq.conf
d5e66fa71f494b0b5e76603eb324cb771f5bfcbe1922fe0a1a68b8512c654c5a
docker: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"rootfs_linux.go:57: mounting \\\"/tmp/srv/dnsmasq/dnsmasq.conf\\\" to rootfs \\\"/var/snap/docker/common/var-lib-docker/aufs/mnt/a8a86ba50e20401aaf5f36873c211cad3de198b6be4c44b9d3d9440882f3136e\\\" at \\\"/var/snap/docker/common/var-lib-docker/aufs/mnt/a8a86ba50e20401aaf5f36873c211cad3de198b6be4c44b9d3d9440882f3136e/etc/dnsmasq.conf\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

用于绑定安装的卷在那里:

» tree /tmp/srv/
/tmp/srv/
└── dnsmasq
    ├── dnsmasq.conf
    ├── dnsmasq.d
    │   └── others.conf
    └── hosts

2 directories, 3 files

我还能尝试什么?

0 个答案:

没有答案