centos7 安装docker-ce docker-compose
- 安装依赖
- 更换repo
- 安装docker-ce
- 验证docker
- docker使用报错
安装依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
更换repo
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker-ce
yum install docker-ce
验证docker
sudo systemctl start docker
sudo docker run hello-world
docker使用报错
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
systemctl daemon-reload
sudo service docker restart
sudo service docker status
docker images