Docker#
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
# 官方源地址
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
# 阿里云
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# 清华大学源
sudo yum-config-manager \
--add-repo \
https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl enable docker --now
容器镜像加速#
sudo mkdir -p /etc/docker
# 阿里云容器镜像加速服务
sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://bvyp19gi.mirror.aliyuncs.com"] } EOF
# 重载docker配置
sudo systemctl daemon-reload
# 重启docker服务
sudo systemctl restart docker
Docker-compose安装#
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo yum update
sudo yum install docker-compose-plugin
sudo apt-get update
sudo apt-get install docker-compose-plugin
- 通过检查版本来验证 Docker Compose 是否已正确安装。
...