Ubuntu安装Docker

方案1:

  1. sudo wget -qO- https://get.docker.com/ | sh

方案2:

  1. sudo apt-get update
  2. sudo apt-get install docker-engine

方案3:

  1. sudo apt-get update
  2. sudo apt-get install apt-transport-https ca-certificates
  3. sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  4. sudo vi /etc/apt/sources.list.d/docker.list
  5. deb https://apt.dockerproject.org/repo ubuntu-xenial main
  6. sudo apt-get update
  7. sudo apt-get install docker-engine

启动docker 服务

  1. sudo service docker start

CentOS安装Docker

更新yum命令资源

  1. sudo yum update

安装docker

  1. sudo yum install docker-engine

启动docker 服务

  1. sudo systemctl enable docker.service
  2. sudo systemctl start docker