确认 containerd 版本
1.5 之前使用 mirrors;1.5 及以后使用 certs.d/hosts.toml 目录化配置。
containerd --version适合 Kubernetes、K3s、使用 containerd 的节点。先确认 containerd 版本,再选择对应配置方式。
docker.1ms.runghcr.1ms.run1.5 之前使用 mirrors;1.5 及以后使用 certs.d/hosts.toml 目录化配置。
containerd --version使用 certs.d/hosts.toml 配置。
containerd 1.5+ 需要确认 config.toml 指向 certs.d。
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"仅为 Docker Hub 和 GHCR 配置免费公共镜像源。
BASE=/etc/containerd/certs.d
mkdir -p "$BASE/docker.io"
mkdir -p "$BASE/ghcr.io"仅为 Docker Hub 和 GHCR 配置免费公共镜像源。
# /etc/containerd/certs.d/docker.io/hosts.toml
server = "https://registry-1.docker.io"
[host."https://docker.1ms.run"]
capabilities = ["pull", "resolve"]
# /etc/containerd/certs.d/ghcr.io/hosts.toml
server = "https://ghcr.io"
[host."https://ghcr.1ms.run"]
capabilities = ["pull", "resolve"]重启 containerd 后,拉取 Docker Hub 镜像验证配置。
systemctl restart containerd
crictl pull docker.io/library/redis:7-alpine使用 config.toml 中的 mirrors 配置。
仅为 Docker Hub 和 GHCR 配置免费公共镜像源。
[plugins."io.containerd.grpc.v1.cri".registry]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["https://docker.1ms.run"]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."ghcr.io"]
endpoint = ["https://ghcr.1ms.run"]Containerd 1.5 之前配置完成后需要重启服务并检查状态。
systemctl restart containerd
systemctl status containerd运行以下命令,确认镜像下载成功。若失败,请核对 containerd 版本、配置路径及镜像地址。
crictl pull docker.io/library/redis:7-alpine以下是公共地址示例。使用专属域名时,请复制上方引导步骤中生成的内容。
docker.iodocker.1ms.run可选免费、付费ghcr.ioghcr.1ms.run必须免费、付费gcr.iogcr.1ms.run必须付费registry.k8s.iok8s.1ms.run必须付费nvcr.ionvcr.1ms.run必须付费quay.ioquay.1ms.run必须付费mcr.microsoft.commcr.1ms.run必须付费docker.elastic.coelastic.1ms.run必须付费仅 docker.io 会自动补全 library/ 和 latest;非 library 官方镜像请写完整命名空间。
docker pull nginxdocker pull docker.1ms.run/nginx免费用户也可使用 ghcr.io 通道,需将域名前缀替换为 ghcr.1ms.run。
docker pull ghcr.io/linuxserver/webtop:latestdocker pull ghcr.1ms.run/linuxserver/webtop:latest付费通道支持 registry.k8s.io,不会自动补全 library/。
docker pull registry.k8s.io/pausedocker pull k8s.1ms.run/pauseCompose 文件只需要替换 image 字段中的域名前缀。
image: ghcr.io/linuxserver/webtop:latestimage: ghcr.1ms.run/linuxserver/webtop:latest新机器可先安装 Docker,并将默认镜像源配置为毫秒镜像。
bash <(curl -f -s --connect-timeout 10 --retry 3 https://linuxmirrors.cn/docker.sh) --source mirrors.tencent.com/docker-ce --source-registry docker.1ms.run --protocol https --install-latested true --close-firewall false --ignore-backup-tips安装最新 docker-compose,并创建 /usr/bin/docker-compose 软链接。
sudo curl -L "https://1ms.run/install/docker-compose/latest/$(uname -s)/$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose推荐付费用户使用,会按提示完成账号配置和加速配置。
bash <(curl -sSL https://n3.ink/helper)用户名使用 1ms,密码使用用户中心创建的 Docker 密钥。
docker login docker.1ms.run需要更多帮助? 查看完整使用文档