# CentOS 安装 Docker 与镜像加速

发布日期：2026-07-23

这份笔记记录 CentOS 环境下安装 Docker 的常用步骤。实际操作前建议先确认系统版本、yum 源可用性，以及当前用户是否具备 sudo 权限。

## 脚本安装

```shell
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
```

## 手动安装

```shell
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io
systemctl start docker
```

## 普通用户执行 Docker

```shell
sudo groupadd docker
sudo gpasswd -a $USER docker
newgrp docker
docker ps
```

## 镜像加速

```json
{
  "registry-mirrors": ["https://reg-mirror.qiniu.com/"]
}
```
