0_ubuntu_docker.md
· 76 B · Markdown
Raw
# Install Docker on Ubuntu
- https://docs.docker.com/engine/install/ubuntu/
Install Docker on Ubuntu
1_remove_old_package.sh
· 129 B · Bash
Raw
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
1 | for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done |
2_apt_source.sh
· 585 B · Bash
Raw
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get 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
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
1 | # Add Docker's official GPG key: |
2 | sudo apt-get update |
3 | sudo apt-get install ca-certificates curl |
4 | sudo install -m 0755 -d /etc/apt/keyrings |
5 | sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc |
6 | sudo chmod a+r /etc/apt/keyrings/docker.asc |
7 | |
8 | # Add the repository to Apt sources: |
9 | echo \ |
10 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
11 | $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ |
12 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
13 | sudo apt-get update |
3_install_docker.sh
· 101 B · Bash
Raw
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
1 | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |