CentOS安装docker

yum install -y yum-utils
# 中央仓库,速度会很慢,建议使用国内源安装
yum-config-manager  --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# 阿里仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
 # 安装最新版docker,  指定版本:docker-ce-版本号
yum install -y  docker-ce docker-ce-cli containerd.io
# 设置开机启动、启动服务
systemctl enable docker   &&  systemctl start docker
# 安装docker-compose
curl -L https://github.com/docker/compose/releases/download/v2.17.3/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

# docker镜像国内加速器, 没有这个文件就新建
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://l7i60qyg.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker

讨论数量: 0

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!