docker_基本安装
YUM源配置
cp -a /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
wget -O /etc/yum.repos.d/docker-ce.repo https://repo.huaweicloud.com/docker-ce/linux/centos/docker-ce.repo
sudo sed -i 's+download.docker.com+repo.huaweicloud.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
yum clean all
yum makecache fast
sudo yum remove docker docker-common docker-selinux docker-engine
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum install docker-ce -y
镜像仓库配置
- 阿里云-->容器镜像服务-->镜像工具-->镜像加速器
https://XXXXXXX.mirror.aliyuncs.com 代表个人镜像地址
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://XXXXXXX.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
docker-compose安装
yum install python3
pip3 install --upgrade pip
pip3 install docker-compose
docker文档
网页地址 | 描述 |
---|---|
https://docs.docker.com/reference/ | docker命令查询文档 |