- 方式一
sudo apt-get install -y docker.io
source /etc/bash_completion.d/docker.io
//查看版本
sudo docker.io version
- 方式二
sudo apt-get install -y curl
sudo curl -sSL https://get.docker.com/ | sudo sh
检查版本
sudo docker version
Client:
Version: 1.13.1
API version: 1.26
Go version: go1.6.2
Git commit: 092cba3
Built: Thu Nov 2 20:40:26 2017
OS/Arch: linux/386
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Go version: go1.6.2
Git commit: 092cba3
Built: Thu Nov 2 20:40:26 2017
OS/Arch: linux/386
Experimental: false
使用非root用户
sudo groupadd docker
sudo gpasswd -a hejing docker // 将hejing替换为你的用户
sudo service docker restart
需要注销重新登录
hejing@learning:~$ docker run ubuntu echo "hi jack"
hi jack