Docker未知标志--mount [英] Docker Unknown flag --mount
本文介绍了Docker未知标志--mount的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过volume
上的mount flag
将目录从主机装载到容器,但是我得到`仅在使用mount标志而不是对volume时会遇到这种情况
I want to mount a directory from the host to a container using the mount flag
over volume
but I am getting ` This is only experienced when using mount flag and not with volume
*Command:*
docker run -d -it --name devtest --mount type=bind,source="$(pwd)",target=/home/ httpd
错误未知标志:--mount
Error unknown flag: --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
推荐答案
docker run
对--mount
选项的支持仅在Docker
docker run
support for the --mount
option was only introduced in Docker 17.06. You are using Docker 1.13.1
. You have two choices:
- 如果可能的话,更新到Docker
17.06
或更高版本; - 使用
-v
方法绑定安装所需的卷,例如docker run -v $(pwd):/home
- Update to Docker
17.06
or later if you can; - Use the
-v
approach to bind mount the volume you require e.g.docker run -v $(pwd):/home
这篇关于Docker未知标志--mount的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文