项目云环境搭建(3)——Docker环境的搭建

一:由于apt官方库里的docker版本可能比较旧,所以先卸载可能存在的旧版本:

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

二:更新apt包索引:

$ sudo apt-get update

三:安装以下包以使apt可以通过HTTPS使用存储库(repository):

$ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common

四:添加Docker官方的GPG密钥:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

五:使用下面的命令来设置stable存储库:

$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

六:再更新一下apt包索引:

$ sudo apt-get update

七:安装最新版本的Docker CE:

$ sudo apt-get install -y docker-ce

八:查看docker服务是否启动:

$ systemctl status docker

九:若未启动,则启动docker服务:

$ sudo systemctl start docker

十:测试安装Docker成功:

发布了36 篇原创文章 · 获赞 34 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/weixin_41605937/article/details/103690405