Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon

Working with Docker Swarm

The student will be tasked to work with Docker and configure one management node and one client node, with the Docker service running. They will then need to add the client node to a swarm cluster and work with services across the swarm.

Google Cloud Platform icon

Path Info

Clock icon Intermediate
Clock icon 1h 0m
Clock icon Jul 30, 2018

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Initialize your Master Node

    Before you can create a service, you have to initialize the swarm master. You can accomplish this via:

    docker swarm init

    NOTE: Be sure to capture the output of the command so that you can use it on your node to register with the master!

  2. Challenge

    Register Your Node with the Swarm Master

    Once the master has been initialized, you will have captured the 'join' command containing the token you need. The command will look something like this. You will run the following command on the second server in your configuration:

    docker swarm join --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2

    NOTE: Your token string AND IP will differ for your lab, this is an example of the command you will run

  3. Challenge

    Create the Service in Your Swarm

    Be sure you download the image you plan to work with:

    docker pull httpd

    Now, on the master server, you can run the following command to run your service:

    docker service create --name our_api --replicas=2 httpd:latest

    This will create a service with two replicas, one running on each node in the swarm

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans