Advisory: This site contains documentation for the v1.12 release candidate version of Docker Engine. For the Docker Engine v1.11 docs, see https://docs.docker.com/v1.11/. Docker for Mac and Docker for Windows are currently in Beta.
Open a terminal and ssh into the machine where you run your manager node. For
example, the tutorial uses a machine named
Run the the following command:
$ docker service create --replicas 1 --name helloworld alpine ping docker.com 9uk4639qpg7npwf3fn2aasksr
docker service createcommand creates the service.
--nameflag names the service
--replicasflag specifies the desired state of 1 running instance.
alpine ping docker.comdefine the service as an Alpine Linux container that executes the command
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
Now you’ve deployed a service to the swarm, you’re ready to inspect the service.