Docker Unknown标志 - 装载

时间:2018-01-09 12:09:59

标签: docker containers mount

我想使用挂载flag通过volume将主机上的目录挂载到容器,但我得到`这只是在使用挂载标志而不是卷时才会遇到

*Command:*
    docker run -d  -it  --name devtest --mount type=bind,source="$(pwd)",target=/home/  httpd
  

错误未知标志: - mount

Server Version: 1.13.1
Storage Driver: aufs
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: "deleted" 
Profile: default
Kernel Version: 4.10.0-42-generic
Operating System: Ubuntu 17.04
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.715 GiB
Name: "deleted"
ID: "deleted"
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

1 个答案:

答案 0 :(得分:12)

docker run仅在Docker 17.06中引入了对--mount选项的支持。您正在使用Docker 1.13.1。你有两个选择:

  1. 如果可以,请更新到Docker 17.06或更高版本;
  2. 使用-v方法绑定挂载您需要的卷,例如docker run -v $(pwd):/home