docker - 安装

install docker

  1. 让apt工作在https模式下
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
  1. 添加gpg key
sudo apt-key adv \
               --keyserver hkp://ha.pool.sks-keyservers.net:80 \
               --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  1. 添加docker sourcelist(不同Ubuntu版本,对应的source不一样)
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
  1. update source
sudo apt-get update
  1. 验证docker 的 apt源
apt-cache policy docker-engine
  1. 安装docker
sudo apt-get install docker-engine
  1. 将当前用户添加到docker group
sudo groupadd docker
sudo usermod -aG docker $USER
  1. 运行hello world
docker run hello-world
posted @ 2017-02-07 21:17  lacker  阅读(320)  评论(0编辑  收藏  举报