安装
- Ubuntu 版本信息
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
getconf LONG_BIT
64
uname -a
Linux u-develop 4.18.0-20-generic #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linu
- 卸载旧版本
sudo apt-get remove docker docker-engine docker.io containerd runc
- 更新仓库信息
允许使用HTTPSsudo apt-get update
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
- 添加GPG Key
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
验证Key的指纹
sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) docker@docker.com
sub rsa4096 2017-02-22 [S]
*添加稳定版本Repository
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
- 安装最新版本的docker ce和containerd
sudo apt-get install docker-ce docker-ce-cli containerd.io
- 验证DOCKER
sudo docker run hello-world
如果本地没有这个镜像,会从远程仓库中下载下来。
网友评论