本镜像提供 Debian/Ubuntu/Fedora/CentOS/RHEL 的 docker 软件包。
注意:本镜像不是 dockerhub 。
Docker 提供了一个自动配置与安装的脚本,支持 Debian、RHEL、SUSE 系列及衍生系统的安装。请注意,Docker 官方不建议在生产环境使用此脚本安装 Docker CE。
以下内容假定
export DOWNLOAD_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce"
# 如您使用 curl
curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh | sh
# 如您使用 wget
wget -O- https://raw.githubusercontent.com/docker/docker-install/master/install.sh | sh 以下内容根据 官方文档 修改而来。
如果你过去安装过 docker,先删掉:
apt remove $(dpkg --get-selections docker.io docker-compose docker-doc podman-docker containerd runc | cut -f1) 首先安装依赖:
apt-get update
apt-get install ca-certificates curl 信任 Docker 的 GPG 公钥并添加仓库:
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF 最后安装
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 以下内容根据 官方文档 修改而来。
如果你之前安装过 docker,请先删掉:
dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine 安装依赖,下载 repo 文件,并把软件仓库地址替换为镜像站:
dnf config-manager addrepo --from-repofile https://download.docker.com/linux/fedora/docker-ce.repo
sed -i 's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo 最后安装:
dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 以下内容根据 官方文档 修改而来。
如果你之前安装过 docker,请先删掉
dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine 安装依赖,下载 repo 文件,并把软件仓库地址替换为镜像站:
dnf -y install dnf-plugins-core
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sed -i 's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo 最后安装:
yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 本节供 OpenMediaVault 帮助使用。
omv-env set OMV_DOCKER_APT_REPOSITORY_URL "https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian"