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 install docker-ce -y
sudo usermod -aG docker $(whoami)
# 启动
sudo systemctl enable docker.service
sudo systemctl start docker.service
# 安装docker-compose
sudo yum install epel-release -y
sudo yum install -y python-pip
sudo pip install docker-compose
docker-compose version
# 添加国内源
sudo touch /etc/docker/daemon.json
sudo vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
网友评论