• 8 hours
  • Medium

Free online content available in this course.

course.header.alt.is_certifying

Got it!

Last updated on 11/10/22

Install Docker on Your Workstation

In the last chapter, we saw the different versions of Docker that we might find ourselves using. We’re now going to take a closer look at two of those: Docker for Mac/Docker for Windows, and Docker Community Edition (CE).

Install Docker for Mac and Docker for Windows

Docker Hub

Docker Hub is a service provided by Docker, Inc. Think of it like GitHub, but specialized in storing images for Docker.

To download and use Docker (and for the purposes of the rest of this course), you’ll need to create an account on Docker Hub

Stable vs. Edge Version

Docker, Inc. distributes two versions of Docker for Mac and for Docker Windows clients.

There is a Stable version which is updated quarterly, and an Edge version containing beta features, which is available every month.

We’re going to go for the Stable version, as it will give us a functional and stable environment while you’re learning all about Docker.

Now that you have a working Docker Hub account and we know which version we want to use, we can install Docker for Windows and Docker for Mac.

Docker for Windows

The tool created by Docker, Inc. will create a Hyper-V virtual machine on Windows, and then install Docker within this.

Once the download is complete, you can run the tool and go through its installation procedure. Note that you’ll need to restart your PC.

Once the installation is complete, you’ll be prompted to connect the Docker Hub account you created earlier.

Docker for Windows is now ready to go on your PC!

Docker for Mac

Installing Docker for Mac works in the same way as Docker for Windows.

Take a look at the video above to see a demonstration of the installation procedure.

Install Docker Community Edition

For the Docker Community Edition version, you don’t need to create an account on Docker Hub. However, just to keep things the same, we’re also going to create an account on Docker Hub here and log in.

We’re assuming that you’re using a Linux machine running Debian, onto which you’ll be installing Docker CE. To see how to install Docker on another Linux distribution, take a look over the Docker documentation.

Start by updating your system and installing the prerequisites for Docker installation:

sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

Once that’s done, add the Docker repository:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg –dearmor -o /etc/apt/trusted.gpg.d/docker.gpg
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

You can now install Docker on your machine:

sudo apt update && sudo apt-get install docker-ce docker-ce-cli containerd.io

You now have Docker on your computer. However, you don’t have the required access to be able to talk with the daemon. To resolve this issue, use the following command:  sudo usermod -aG docker your-user.

After restarting your user session, you’ll be able to communicate with the Docker daemon and use Docker normally.

As we said before, to keep things the same, we’re also going to connect to Docker Hub with the  docker login  command. Use the account that you’ve just created on Docker Hub.

Let’s Recap!

  • You now know how to install the relevant version of Docker for your OS.

  • You also know how to connect to Docker Hub.

In the next part, you’ll start using Docker to run images, and you’ll also learn how to create them using Dockerfiles.

Example of certificate of achievement
Example of certificate of achievement