Convert "docker run" into "docker service create"


I have trouble converting command from single “docker run” into “docker service create”, and didn’t find clear documentation about it :frowning:
Source command is: docker run -d -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock uifd/ui-for-docker
Target command expected: docker service create --replicas 1 --name docker-ui -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock uifd/ui-for-docker

Unfortunately, was not able to find analogue for “–privleged” and “-v”, and command fail with “unknown flag” errors. Can you advice me something? Thank you :slight_smile:

This is exactly the same issue I’m having. There is no way I can see with “docker service create” to allow the --privileged flag. Is this missing, or something intended in the design?

For the socket mapping, you can try in a service:
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock
See definition:
See other example:

1 Like