美文网首页
Ubuntu16.04虚拟机配置docker

Ubuntu16.04虚拟机配置docker

作者: AI_Engine | 来源:发表于2018-03-15 17:29 被阅读188次

    声明:本人是在ubuntu16.04版本的虚拟机上进行配置(建议内核版本低一些,我是内核比较高的那种),其余版本的坑还未踩。。。以下就是配置docker环境的步骤:

    1.移除旧版(可能会报错,比如找不到docker-engine,因为可能根本就没有旧版):sudo apt-get remove docker docker-engine docker.io 

    2.sudo apt update

    3.查看一下自己的内核:uname -r

      我的是4.10.0-28-generic,版本比较高,比较坑。。。

    4.sudo apt-get install linux-image-4.10.0-28-generic

    5.更新apt包索引:sudo apt update

    6.安装https支持包:sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

    7.添加稳定版的仓库源(按架构选择,我的是amd64,别坑自己)

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

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

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

    8.更新apt包索引:sudo apt update

    9.安装(可能会报错:docker-ce : 依赖: libseccomp2 (>= 2.3.0) 但是 2.2.3-3ubuntu3 正要被安装............):sudo apt-get install docker-ce

       如果报上面的错误解决方法如下:sudo apt install aptitude,sudo aptitude install docker-ce

    10.测试(如果提示没有docker.io或者没有docker命令,没关系,安装一下就是了):sudo docker run hello-world

    相关文章

      网友评论

          本文标题:Ubuntu16.04虚拟机配置docker

          本文链接:https://www.haomeiwen.com/subject/qsghqftx.html