Install Docker on Ubuntu 22 04

Опубликовано: 29 Ноябрь 2024
на канале: james kiarie
983
16

#docker #ubuntu22
This video illustrates how to install Docker on Ubuntu 22.04.


Timestamp

0:00 Introduction

1:14 Install Docker from default Ubuntu repositories

6:08 Install Docker from the Official Docker repository

12:15 Test Docker installation


Installing Docker from the Default Ubuntu Repositories

Step 1: Update the package index

sudo apt update

Step 2: Install Docker from default repositories

sudo apt install docker.io -y


Step 3: Add the logged-in user to the Docker group

sudo usermod -aG docker $USER

newgrp docker


Step 4: Check installation

sudo systemctl status docker

sudo systemctl enable docker

docker version


Installing Docker from the Official Docker Repository

Step 1: Update the Package Repository

sudo apt update

Step 2: Install Prerequisite Packages

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y

Step 3: Add the GPG key for the official Docker repository

curl -fsSL https://download.docker.com/linux/ubu... | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Step 4: Add Docker repository to APT repository

echo "deb [arch=$(dpkg --print-architecture) 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

** There's an angled bracket between docker.list and /dev/null. YouTube doesn't allow me to add it.

Step 5: Install Docker

sudo apt install docker-ce -y

Step 6: Add the logged-in user to the Docker group

sudo usermod -aG docker $USER

newgrp docker

groups user


Step 7: Verify installation of Docker

sudo systemctl status docker

sudo systemctl enable docker



docker version