-->

Saturday, February 5, 2022

[Solved] invalid argument "type=bind," for "--mount" flag: invalid field '' must be a key=value pair

Issue:- 

The issue occured while specifying docker to use the bindmount for the volume with following command

docker service create --name=viz --publish=8080:8080/tcp --constraint=node.role==manager --mount=type=bind, src=/var/run/docker.sock,dst=/var/run/docker.sock dockersamples/visualizer

Error:- 

 invalid argument "type=bind," for "--mount" flag: invalid field '' must be a key=value pair

Resolution:-

The issue is coming because there is a space between the , and src in the above command. Make sure there is no space between mount=type=bind, src=/var/run/docker.sock like mount=type=bind,src=/var/run/docker.sock Than it should work fine.

docker service create --name=viz --publish=8080:8080/tcp --constraint=node.role==manager --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock dockersamples/visualizer

0 comments:

Post a Comment