参考链接
安装相关依赖
1 2
| sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common
|
添加 apt 软件源信息
根据主机服务商选择下列其中一项,不对号入座的话下载速度会比较慢
1 2 3
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
|
1 2 3
| curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
|
1 2 3
| curl -fsSL https://mirrors.cloud.tencent.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] http://mirrors.cloud.tencent.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
|
确认 docker-ce repo 信息
1
| apt-cache policy docker-ce
|
安装 Docker
1
| sudo apt install docker-ce
|
检查 Docker 运行状态
1
| sudo systemctl status docker
|
1 2 3
| sudo usermod -aG docker ${USER}
su - ${USER}
|