玖叶教程网

前端编程开发入门

ubuntu18.04 安装docker



服务器是腾讯云的低配,已经吃灰好久,只放了公交的api,最近还被黑了,重装了系统,放着也是放着,打算拿来学习docker。

1.更新系统软件

sudo apt-get update

2.安装依赖包

sudo apt-get install \    
apt-transport-https \ 
ca-certificates \    
curl \ 
gnupg-agent \    
software-properties-common

3.下载并安装秘钥,任选其一就行

# 官方源
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 中科大源
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 清华源
$ curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 检查秘钥是否安装成功
$ sudo apt-key fingerprint 0EBFCD88

4.添加安装docker的软件源,如果觉得官方源慢的,可以选择中科大源和清华源

之前我没有设置源,导致安装失败,这里可以选择中科大源或者清华源

# 中科大源
$ sudo add-apt-repository \   
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \   
$(lsb_release -cs) \   stable"     

# 清华源$ sudo add-apt-repository \  
"deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \  
$(lsb_release -cs) \  stable"

5.安装docker-ce

sudo apt install docker-ce

到这,就安装完成了。

发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言