banner
Bai

Bai

写代码菜的一批 🤣
twitter
telegram
tg_channel
pixiv
github
bilibili
whatsapp

Install the latest Docker and Docker Compose on Ubuntu.

Uninstall the old version of Docker (if any):

sudo apt-get remove docker docker-engine docker.io containerd runc

Update the package index and install dependencies:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release

Add the Docker official GPG key:

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

Set up the stable version Docker repository with the following command:

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

Install the latest version of Docker:

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

Add the current user to the docker group to allow running Docker commands without using sudo:

sudo usermod -aG docker $USER

Install Docker Compose:

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Confirm that Docker and Docker Compose have been successfully installed and are running:

docker --version
docker-compose --version

You should now have successfully installed the latest versions of Docker and Docker Compose.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.