From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- ...Fswarm%2Fswarm-tutorial%2Fdeploy-service%2Findex.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fdeploy-service%2Findex.html (limited to 'devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fdeploy-service%2Findex.html') diff --git a/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fdeploy-service%2Findex.html b/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fdeploy-service%2Findex.html new file mode 100644 index 00000000..38aad034 --- /dev/null +++ b/devdocs/docker/engine%2Fswarm%2Fswarm-tutorial%2Fdeploy-service%2Findex.html @@ -0,0 +1,16 @@ +

Deploy a service to the swarm

+

After you create a swarm, you can deploy a service to the swarm. For this tutorial, you also added 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
    +
    • The docker service create command creates the service.
    • The --name flag names the service helloworld.
    • The --replicas flag specifies the desired state of 1 running instance.
    • The arguments alpine ping docker.com define the service as an Alpine Linux container that executes the command ping docker.com.
  3. 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
    +

What’s next?

Now you’ve deployed a service to the swarm, you’re ready to inspect the service.

+

tutorial, cluster management, swarm mode

+
+

+ © 2019 Docker, Inc.
Licensed under the Apache License, Version 2.0.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.
Docker, Inc. and other parties may also have trademark rights in other terms used herein.
+ https://docs.docker.com/engine/swarm/swarm-tutorial/deploy-service/ +

+
-- cgit v1.2.3