Liunx系统版本要求
CentOS:7
Ubuntu:16.04(Xenial LTS)、14.04(Trusty LTS)、17.04(Zesty)
Debian:7.7(Wheezy LTS)、8.0(Jessie LTS)、9(Stretch)
Fedora:24、25
CentOS 7(使用yum安装)
sudo yum install -y yum -utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce
sudo service docker start
Ubuntu 14.04/16.04(使用 apt-get 进行安装)
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt-get -y install docker-ce
sudo service docker start
安装校验
docker version
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://aawksw9m.mirror.aliyuncs.com","https://registry.docker-cn.com"]
}
sudo systemctl daemon-reload
sudo systemctl restart docker
普通用户不使用sudo即可执行docker命令
sudo groupadd docker
sudo gpasswd -a xxx docker
sudo service docker restart
docker命令
sudo service docker start 或 Systemctl stop docker
sudo service docker stop 或 Systemctl stop docker
sudo systemctl restart docker
Systemctl enable docker
docker images
docker ps -a
docker rm 容器id
docker -help