Docker撰写卷无法将目录挂载到文件上(反之亦然)

时间:2017-07-24 08:06:38

标签: docker docker-compose mount docker-machine caddy

我使用带有以下docker-compose配置块的caddy容器:

frontend:
    image: zzrot/alpine-caddy
    ports:
        - "433:433"
        - "80:80"
    volumes:
        - ./share/etc/Caddyfile:/etc/Caddyfile
        - ./root/static:/var/www/htm

当我运行docker-compose时,我看到以下错误:

ERROR: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"rootfs_linux.go:57: mounting \\\"/Users/adam/code/projects/BicycleEvents-Web/share/etc/Caddyfile\\\" to rootfs \\\"/var/lib/docker/aufs/mnt/9e45393ec987dcca75752736c2b4af323ce78838b4d9233059e4d24c6ada193a\\\" at \\\"/var/lib/docker/aufs/mnt/9e45393ec987dcca75752736c2b4af323ce78838b4d9233059e4d24c6ada193a/etc/Caddyfile\\\" 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

这是一段时间以前的工作,但我最近升级了docker-machine并尝试重建容器。

docker-machine version:docker-machine version 0.12.1, build c8b17e8

docker-compose版本:

1.6.0, build d99cad6
docker-py version: 1.7.0
CPython version: 2.7.11
OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016

docker version:

Client:
 Version:      1.10.1
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   9e83765
 Built:        Thu Feb 11 19:14:21 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:19:04 2017
 OS/Arch:      linux/amd64

0 个答案:

没有答案