ubuntu 安装docker

  1. sudo apt-get install docker.io
  2. sudo systemctl start docker 当执行该命令时,如果提示如下错误,请根据解决方式安装:
    System has not been booted with systemd as init system (PID 1). Can't operate.
    解决方式:
    a. sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
    b. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    c. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    d. sudo apt-get update
    e. sudo apt-get install docker-ce
    f. docker --version 执行到这里,如果返回的是版本号,说明docker 已成功安装,则以下步骤就无需继续执行
  3. sudo systemctl enable docker
  4. sudo addgroup --system docker
  5. sudo adduser $USER docker
  6. newgrp docker

参考:
资料一
资料二
docker文档

你可能感兴趣的:(ubuntu 安装docker)