跟我一起在ubuntu中安装docker

卸载旧版本

$ sudo apt-get remove docker docker-engine docker.io

查看ubuntu版本

设置安装源
通过如下步骤,设置安装源仓库,这里我们使用阿里源

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu
$(lsb_release -cs) stable"

安装docker社区版
通过如下命令将安装docker最新版本

sudo apt-get update
sudo apt-get install docker-ce

检验是否安装成功
通过运行hello-world实例便可检验是否安装成功
卸载docker社区版:

 sudo apt-get purge docker-ce

猜你喜欢

转载自www.cnblogs.com/smart-girl/p/11318827.html