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