- 首先查看自己的uos系统是基于debian还是centos
cat /etc/os-release
PRETTY_NAME="UOS Server 20"
NAME="UOS Server 20"
VERSION_ID="20"
VERSION="20"
ID=uos
HOME_URL="https://www.chinauos.com/"
BUG_REPORT_URL="https://bbs.chinauos.com/"
VERSION_CODENAME=fuyu
PLATFORM_ID="platform:uel20"
[root@aicloud249 ragflow]# which yum || which dnf || which rpm
/usr/bin/yum
which dnf
/usr/bin/dnf
新的机器需要开网并配置一下dns
# cat /etc/resolv.conf
# Generated by NetworkManager
search openstacklocal novalocal
nameserver 172.28.1.22
nameserver 172.28.1.20
[root@ccc-1773736199581 ~]# vi /etc/resolv.conf
说明是基于centos的,参考docker 官方手册里面的安装文档即可:
https://docs.docker.com/engine/install/centos/
sudo dnf install -y docker
启动并设置开机自启
sudo systemctl start docker
[root@ccc-1773036790639 ~]# sudo systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
查看docker状态:
sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2026-03-09 15:05:30 CST; 4min 53s left
Docs: https://docs.docker.com
Main PID: 3082 (dockerd)
Tasks: 29
Memory: 51.2M
CGroup: /system.slice/docker.service
├─3082 /usr/bin/dockerd -H fd:// --log-driver=journald --live-restore --default-ulimit nofile=1024:1024
└─3094 containerd --config /var/run/docker/containerd/containerd.toml
Mar 09 15:05:27 xiaoyu-1773036790639.novalocal dockerd[3094]: time="2026-03-09T15:05:27.945611650+08:00" level=info msg="subscribe ctx=context.Background.WithValue(type transport.connectionKey, val <not Str>
Mar 09 15:05:28 xiaoyu-1773036790639.novalocal dockerd[3082]: time="2026-03-09T15:05:28.438818241+08:00" level=info msg="Loading containers: start."
Mar 09 15:05:28 xiaoyu-1773036790639.novalocal dockerd[3094]: time="2026-03-09T15:05:28.440002702+08:00" level=info msg="subscribe ctx=context.Background.WithValue(type transport.connectionKey, val <not Str>
Mar 09 15:05:29 xiaoyu-1773036790639.novalocal dockerd[3082]: time="2026-03-09T15:05:29.143206732+08:00" level=info msg="Firewalld: interface docker0 already part of docker zone, returning"
Mar 09 15:05:29 xiaoyu-1773036790639.novalocal dockerd[3082]: time="2026-03-09T15:05:29.353039964+08:00" level=info msg="Loading containers: done."
Mar 09 15:05:29 xiaoyu-1773036790639.novalocal dockerd[3082]: time="2026-03-09T15:05:29.628550401+08:00" level=warning msg="Not using native diff for overlay2, this may cause degraded performance for buildi>
Mar 09 15:05:29 xiaoyu-1773036790639.novalocal dockerd[3082]: time="2026-03-09T15:05:29.628792915+08:00" level=info msg="Docker daemon" commit=061aa95809 containerd-snapshotter=false storage-driver=overlay2>
Mar 09 15:05:29 xiaoyu-1773036790639.novalocal dockerd[3082]: time="2026-03-09T15:05:29.628890719+08:00" level=info msg="Daemon has completed initialization"
Mar 09 15:05:30 xiaoyu-1773036790639.novalocal dockerd[3082]: time="2026-03-09T15:05:30.143444956+08:00" level=info msg="API listen on /run/docker.sock"
Mar 09 15:05:30 xiaoyu-1773036790639.novalocal systemd[1]: Started Docker Application Container Engine.
- 安装过程会报错,记得改源
切换到华为云镜像源,这是目前国内最稳定的 Docker CE RPM 镜像
# 1. 换源
sudo rm -f /etc/yum.repos.d/docker-ce.repo
sudo tee /etc/yum.repos.d/docker-ce.repo <<-'EOF'
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://mirrors.huaweicloud.com/docker-ce/linux/centos/8/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.huaweicloud.com/docker-ce/linux/centos/gpg
EOF
# 2. 清缓存
sudo dnf clean all
# 3. 安装
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# 4. 启动
sudo systemctl enable --now docker
- 如果拉不下来镜像,配置如下操作
sudo tee /etc/docker/daemon.json > /dev/null <<EOF
{
"insecure-registries": ["172.28.0.32:3443"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl status docker.service
4.装git
sudo dnf install git -y
5.遇到docker-ce和docker冲突的话
# 1. 先卸载系统自带全套容器组件(必执行,规避冲突)
sudo dnf remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine containerd runc podman podman-docker
sudo dnf autoremove -y
# 2. 再安装官方docker-ce,无需加--allowerasing
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# 3. 启动自启
sudo systemctl enable --now docker