Ubuntu安装docker

1.更新apt包索引

sudo apt-get update
Ubuntu安装docker

2.安装如下包使得apt能够通过HTTPS使用仓库(有一个地方需要按y)

sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
安装如下包使得apt能够通过HTTPS使用仓库

3.添加docker官方GPG密钥:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
添加docker官方GPG密钥:

4.添加stable仓库:针对x86_64/amd64

sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
添加stable仓库:针对x86_64/amd64

5.更新apt包索引

sudo apt-get update
更新apt包索引

6.安装最新版本的docker CE(有一个地方需要按y)

sudo apt-get install docker-ce
安装最新版本的docker CE

7.查看是否安装成功: 

docker -v

8.打开docker服务:

systemctl start docker
打开docker服务:

9.查看docker镜像

docker images
查看docker镜像

安装成功!!!

类似文章

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注