Ubuntu20.04安装Docker
官方安装地址:Install Docker Engine on Ubuntu | Docker Documentation
卸载旧版本
1
| sudo apt-get remove docker docker-engine docker.io containerd runc
|
使用仓库安装Docker
1 2 3 4 5
| sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release
|
1
| sudo mkdir -p /etc/apt/keyrings
|
1
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
1 2 3
| echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
安装Docker Engine
1
| sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
终极一步
1
| sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
输出Hello World
安装完毕!