docker安装

# 新部署方案
# https://developer.aliyun.com/mirror/docker-ce
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
sudo curl -L "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod 755 /usr/local/bin/docker-compose



# 需要的安装包:
yum install -y yum-utils

# 设置镜像仓库(此处选择阿里云):
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
### 华为云(openEuler)
yum-config-manager --add-repo https://repo.huaweicloud.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's/$releasever/7/g' docker-ce.repo

# 更新yml软件包索引
yum makecache fast

# 安装docker相关内容 (docker-ce 社区 ee企业版)
yum install -y docker-ce docker-ce-cli containerd.io

# 启动docker:
systemctl start docker
systemctl enable docker

# 可查看docker版本
docker version 

# 测试hello-world:
docker run hello-world
docker images

ref: https://blog.csdn.net/fy512/article/details/122668330

https://developer.aliyun.com/mirror/docker-ce

修改国内数据源

cat >> /etc/docker/daemon.json <<'EOF'
{
    "registry-mirrors": [
        "https://hub-mirror.c.163.com/",
        "https://docker.mirrors.ustc.edu.cn/"
    ]
}
EOF

systemctl daemon-reload
systemctl restart docker
posted @ 2022-06-21 18:09  chenzechao  阅读(22)  评论(0编辑  收藏  举报