Docker lab setup on Ubuntu 22.04 Server LTS

Lab1 Setting up docker on Centos8

yum remove podman*

yum remove runc* containerd* buildah*

sudo yum install -y yum-utils

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

systemctl enable docker

systemctl start docker

systemctl status docker

Lab2: Setup on ubuntu

First, update your existing list of packages

sudo apt update

Install a few prerequisite packages which let apt use packages over HTTPS:

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

Add the GPG key for the official Docker repository to your system

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

Add the Docker repository to APT sources:

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

Update your existing list of packages

sudo apt update

Install Docker:

sudo apt install docker-ce docker-ce-cli containerd.io

Check that it’s running:

sudo systemctl status docker