Skip to main content

Docker CE Mirror Usage Guide

info

Some content in this document may have been translated by AI.

caution

This mirror is not DockerHub and can only be used to install Docker CE. It cannot be used to index or pull container images from DockerHub!!!

Docker CE Introduction

Docker CE, or Docker Community Edition, is the free version of Docker for developers and small teams. It provides community support and faster update cycles. It is hosted at https://download.docker.com.

Automatic Installation

Docker officially provides an automatic configuration and installation script that supports installation on Debian, RHEL, SUSE series, and derivative systems.

caution

Docker officially does not recommend using this script to install Docker CE in production environments!!!

操作方法:执行命令

执行命令:

是否为 root 用户
sudo curl -fsSL https://get.docker.com -o get-docker.sh
sudo DOWNLOAD_URL=https://mirrors.hust.edu.cn/docker-ce sh get-docker.sh

Manual Installation

Debian/Ubuntu/Raspbian

  1. First remove Docker maintained by the official repository:
Whether root user
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt remove -y ${pkg}; done
  1. Preparation:
Distribution
Ubuntu
Whether root user
# Install dependencies
sudo apt install -y gnupg ca-certificates

# Configure GPG public key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Configure software source
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null << EOF
deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.hust.edu.cn/docker-ce/linux/ubuntu $(lsb_release -sc) stable
EOF
  1. Install Docker CE:
Whether root user
sudo apt update -y && sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Fedora

  1. First remove Docker maintained by the official repository:
Whether root user
for pkg in docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine; do sudo dnf remove -y ${pkg}; done
  1. Install dependencies, download repo file, and replace the software repository address with the mirror site:
Whether root user
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo sed -i 's+https://download.docker.com+https://mirrors.hust.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
  1. Install Docker CE:
Whether root user
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

CentOS/RHEL

  1. First remove Docker maintained by the official repository:
Whether root user
for pkg in docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine; do sudo yum remove -y ${pkg}; done
  1. Install dependencies, download repo file, and replace the software repository address with the mirror site:
Distribution
CentOS
Whether root user
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo sed -i 's+https://download.docker.com+https://mirrors.hust.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
  1. Install Docker CE:
Whether root user
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

References

  1. Tsinghua Mirror Usage Guide
Choose your prefered domain
mirrors.hust.edu.cn
This domain is Dual Stack
Enable HTTPS