- switch Docker APT repo config from docker.list to docker.sources - keep GPG key in /etc/apt/keyrings/docker.asc - remove installation of legacy docker-compose package - use docker-compose-plugin as the recommended Compose integration - add cleanup of old/conflicting Docker-related packages before install - align installation steps with current Docker documentation for Ubuntu
21 lines
812 B
Bash
21 lines
812 B
Bash
# Remove old/conflicting packages first if they exist
|
|
sudo apt remove docker.io docker-compose docker-compose-v2 docker-doc podman-docker containerd runc
|
|
|
|
sudo apt update
|
|
sudo apt install ca-certificates curl
|
|
sudo install -m 0755 -d /etc/apt/keyrings
|
|
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
|
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
|
|
|
sudo tee /etc/apt/sources.list.d/docker.sources > /dev/null <<EOF
|
|
Types: deb
|
|
URIs: https://download.docker.com/linux/ubuntu
|
|
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
|
|
Components: stable
|
|
Architectures: $(dpkg --print-architecture)
|
|
Signed-By: /etc/apt/keyrings/docker.asc
|
|
EOF
|
|
|
|
sudo apt update
|
|
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|