2022-06-04

Installing Docker

Introduction

In this article, I will walk you through the process of installing Docker, a widely-used containerization platform, on various operating systems, including Windows, macOS, and Linux distributions such as Ubuntu and CentOS.

Installing Docker

System Requirements

Before you begin installing Docker, ensure that your system meets the following requirements:

  • A 64-bit operating system
  • Hardware virtualization support (Intel VT-x or AMD-V)
  • At least 4 GB of RAM
  • An internet connection to download Docker and its components

Installing Docker on Windows

To install Docker on Windows, follow these steps:

  1. Download the Docker Desktop installer for Windows from the official Docker website

https://www.docker.com/products/docker-desktop

  1. Run the installer and follow the on-screen instructions.
  2. Once the installation is complete, restart your computer.
  3. After the restart, launch Docker Desktop to verify the installation.

Installing Docker on macOS

To install Docker on macOS, follow these steps:

  1. Download the Docker Desktop installer for macOS from the official Docker website:

https://www.docker.com/products/docker-desktop

  1. Open the downloaded installer and drag the Docker icon into the Applications folder.
  2. Launch Docker Desktop from the Applications folder to complete the installation.

Installing Docker on Linux

The installation process for Docker on Linux depends on the distribution you are using.

Ubuntu

To install Docker on Ubuntu, run the following commands:

bash
# 1. Update package lists:
$ sudo apt-get update

# 2. Install Docker:
$ sudo apt-get install docker.io

# 3. Enable and start the Docker service:
$ sudo systemctl enable --now docker

# 4. Verify the installation:
$ sudo docker --version

CentOS

To install Docker on CentOS, run the following commands:

bash
# 1. Update package lists:
$ sudo yum update

# 2. Install Docker:
$ sudo yum install docker

# 3. Enable and start the Docker service:
$ sudo systemctl enable --now docker

# 4. Verify the installation:
$ sudo docker --version

Post-Installation Steps and Verifying the Installation

After installing Docker on your system, you may want to perform some post-installation tasks to ensure that everything is set up correctly.

  1. Verify Docker is running:
bash
$ docker info

This command will display information about your Docker installation, such as the number of containers, images, and the version of Docker being used.

  1. Test your Docker installation by running a simple container:
bash
$ docker run hello-world

This command downloads and runs the hello-world Docker image, which is a minimal image used to test if Docker is installed and running correctly. If successful, you should see a message indicating that your installation appears to be working correctly.

$ docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
7050e35b49f5: Pull complete
Digest: sha256:4e8q453afed1b4fa1a3300425191dbfca6ce1e66901fd4c01ff015db3b1bq33e
Status: Downloaded newer image for hello-world:latest

Hello from Docker!

References

https://docs.docker.com/engine/install/
https://www.docker.com/products/docker-desktop

Ryusei Kakujo

researchgatelinkedingithub

Focusing on data science for mobility

Bench Press 100kg!