📜  docker engine install ubuntu - Shell-Bash (1)

📅  最后修改于: 2023-12-03 15:14:45.539000             🧑  作者: Mango

Introduction to Docker Engine Installation on Ubuntu

Docker Engine is a containerization technology that allows you to package applications and services into self-contained containers that can be easily deployed and managed on any infrastructure. Installing Docker Engine on Ubuntu is a straightforward process that can be completed in a few simple steps.

Prerequisites

Before you install Docker Engine on Ubuntu, you must have the following:

  • Ubuntu operating system installed on your machine
  • A user account with administrative privileges
  • A stable internet connection
Installing Docker Engine on Ubuntu

To install Docker Engine on Ubuntu, follow these steps:

Step 1: Update the package index

Make sure that the package index on your Ubuntu system is up-to-date by running the following command in your terminal:

sudo apt-get update
Step 2: Install Docker dependencies

Install the required packages for Docker Engine by running the following command in your terminal:

sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
Step 3: Add Docker's GPG key

Add Docker's official GPG key to your system by running the following command in your terminal:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Step 4: Add Docker's repository

Add Docker's official repository to your system by running the following command in your terminal:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step 5: Install Docker Engine

Finally, install Docker Engine by running the following command in your terminal:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Verify Docker Installation

Once you have installed Docker Engine on Ubuntu, you can verify the installation by running the following command in your terminal:

sudo docker run hello-world

If Docker Engine is installed correctly, you will see a message that says "Hello from Docker!" in your terminal.

Conclusion

In this guide, we have covered the steps required to install Docker Engine on Ubuntu. With Docker, you can easily package applications and services into self-contained containers that can be easily deployed and managed on any infrastructure.