In this tutorial, we will walk you through the installation process of Docker on different platforms including Windows, Mac, and Linux. Docker is an open-source platform that automates the deployment, scaling, and management of applications. It encapsulates software into containers, making it more flexible and portable.
By the end of this tutorial, you will learn how to:
Prerequisites: Basic knowledge of command-line interfaces is beneficial but not required.
Step 1: Visit Docker Hub at https://hub.docker.com/editions/community/docker-ce-desktop-windows/
and download the Docker Desktop for Windows installer.
Step 2: Run the installer and follow the prompts.
Step 3: After installation, start Docker Desktop.
To verify the installation, open a command prompt and enter:
docker --version
You should see the Docker version in the output.
Step 1: Visit Docker Hub at https://hub.docker.com/editions/community/docker-ce-desktop-mac/
and download the Docker Desktop for Mac installer.
Step 2: Open the installer and drag the Docker.app to your Applications folder.
Step 3: Start Docker Desktop.
To verify the installation, open a terminal window and enter:
docker --version
You should see the Docker version in the output.
Step 1: Update your existing list of packages:
sudo apt update
Step 2: Install a few prerequisite packages which let apt use packages over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Step 3: Add the GPG key for the official Docker repository to your system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Step 4: Add the Docker repository to APT sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Step 5: Finally, install Docker:
sudo apt update
sudo apt install docker-ce
To verify the installation, enter:
docker --version
You should see the Docker version in the output.
Here are some examples of expected output when verifying Docker installation:
docker --version
Docker version 20.10.2, build 2291f61
docker --version
Docker version 20.10.2, build 20.10.2-0ubuntu1~20.04.2
In these examples, 20.10.2
is the installed Docker version number.
In this tutorial, we've walked you through the process of installing Docker on Windows, Mac, and Linux. Now you should be able to install Docker on your preferred operating system and verify the installation.
For further learning, we recommend exploring more about Docker commands and how to work with Docker containers.
Here are some exercises to practice:
Solutions:
hello-world
image) and run it, use the following command:docker run hello-world
docker images
Remember, practice is the key to learning any new skill. Happy Dockering!