Docker 安装失败解决方法

  • 卸载旧版本

    #如果之前安装过docker.io,没有跳过
    august@ubuntu:~$ sudo apt-get remove docker docker-engine docker.io
  • 安装AUFS 内核驱动模块

    #aufs是docker存储驱动推荐的内核模块,如果系统没有安装,执行下面脚本
    
    august@ubuntu:~$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
  • 安装镜像源

    #添加使用https传输软件包及CA证书,保证官方源不被篡改
    
    august@ubuntu:~$ sudo apt update
    august@ubuntu:~$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
    
    #国内源,推荐
    august@ubuntu:~$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
    
  • 添加软件源

    #向soruce.list中添加Docker软件源
    
    august@ubuntu:~$ sudo add-apt-repository  "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
  • 安装Docker CE

    #apt 安装docker ce
    
    august@ubuntu:~$ sudo apt-get update
    august@ubuntu:~$ sudo apt-get install docker-ce
  • 启动Docker CE

    #ubuntu14.04使用下面命令
    
    august@ubuntu:~$ sudo service docker start
  • 将当前用户加入docker组

    #默认情况,docker命令会使用unix socket 与docker引擎通讯,只有root和docker的用户才能访问
    
    #建立docker组:默认安装docker时候已经生成
    
    august@ubuntu:~$ sudo groupadd docker
    
    #将当前用户加入 docker 组
    
    sudo usermod -aG docker $USER
    
    #重启Ubuntu系统

猜你喜欢

转载自blog.csdn.net/oHenZiJue/article/details/81183969