Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidawad/8cee7282fe769e455a7e7d611a1032dd to your computer and use it in GitHub Desktop.
Save davidawad/8cee7282fe769e455a7e7d611a1032dd to your computer and use it in GitHub Desktop.
create a docker swarm service
Create a docker swarm service
docker service create \
--name=redis \
--publish=6379:6379/tcp \
--constraint=node.role!=manager \
--mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
arm32v7/redis:latest
@davidawad
Copy link
Author

docker service create
--name=mongo
--publish=27107:27107/tcp
--constraint=node.role!=manager
--mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock
nonoroazoro/rpi-mongo

@davidawad
Copy link
Author

note that with the publish command, the external port is the first argument

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment