温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

docker的安装步骤

发布时间:2021-07-05 18:41:31 来源:亿速云 阅读:118 作者:chen 栏目:大数据

这篇文章主要介绍“docker的安装步骤”,在日常操作中,相信很多人在docker的安装步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”docker的安装步骤”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

1、卸载旧版本

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

2、首次安装,安装镜像仓库

    2.1 更新apt软件包索引

sudo apt-get update

    2.2 添加docker官方GPG秘钥

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

    2.3 配置仓库

vi /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

3、安装docker-ce

    3.1 更新版本

sudo apt-get update

    3.2 安装

        3.2.1 安装最新版本

sudo apt-get install docker-ce

        3.2.2 安装指定版本

sudo apt-get install docker-ce=<VERSION>

      》安装 17.03.2~ce-0~ubuntu-xenial 版本

sudo apt-get install docker-ce=17.03.2~ce-0~ubuntu-xenial

    可能出现的错误

docker的安装步骤

    此问题源于libltdl7版本过低,ubuntu16.04默认无更高版本。

    下载:

wget http://launchpadlibrarian.net/236916213/libltdl7_2.4.6-0.1_amd64.deb

     安装:

sudo dpkg -i libltdl7_2.4.6-0.1_amd64.deb

 再次安装 =》 跳转3.1

4、测试安装

sudo docker run hello-world

docker的安装步骤

就此安装成功!!!

到此,关于“docker的安装步骤”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI