Linux:Ubuntu 20.4 安装docker

1. 更新源

查看文章 :Ubuntu更新源

2. 安装curl软件包

# 安装依赖软件包
apt install apt-transport-https ca-certificates curl software-properties-common

3. 添加docker官方密钥

# 添加密钥信息
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

4. 添加docker源

# 添加docker源
add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

5. 安装docker 

# 安装docker
apt-get install docker-ce docker-ce-cli containerd.io

 6. 测试docker

# 启动docker
systemctl start docker
 
# 停止docker
systemctl stop docker 
 
# 重启docker
systemctl restart  docker

# 配置开机自启
systemctl enable docker

# 查看docker版本
docker -v

 

文章转载至:https://blog.csdn.net/qq_27788177/article/details/120761171

posted @ 2022-10-31 11:08  怒吼的萝卜  阅读(80)  评论(0编辑  收藏  举报