$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
(官方)$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
(国内)$ curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
(官方)
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
(国内)
$ sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update
$ sudo apt-cache madison docker-ce
(最新版本)$ sudo apt-get install docker-ce docker-ce-cli containerd.io
(指定版本)$ sudo apt-get install docker-ce=5:20.10.18~3-0~ubuntu-focal docker-ce-cli=5:20.10.18~3-0~ubuntu-focal containerd.io
$ sudo docker --version
ubuntu安装docker指定版本
于 2022-09-25 20:05:35 首次发布