Deploy a service to the swarm (original) (raw)


This section

Home / Manuals / Docker Engine / Swarm mode / Getting started with Swarm mode / Deploy a service to the swarm

After youcreate a swarm, you can deploy a service to the swarm. For this tutorial, you alsoadded worker nodes, but that is not a requirement to deploy a service.

  1. Open a terminal and ssh into the machine where you run your manager node. For example, the tutorial uses a machine named manager1.
  2. Run the following command:
$ docker service create --replicas 1 --name helloworld alpine ping docker.com  
9uk4639qpg7npwf3fn2aasksr  
  1. Run docker service ls to see the list of running services:
$ docker service ls  
ID            NAME        SCALE  IMAGE   COMMAND  
9uk4639qpg7n  helloworld  1/1    alpine  ping docker.com  

Next steps

Now you're ready to inspect the service.