Containers
tip
镜像站点现在越来越不可靠了,有一个保底的办法是通过可以直连的机器 pull 镜像,然后打包传输到目标机器上。
# 有互联网的机器
docker pull <image>
docker save -o my-app.tar my-app:latest
# 最好再压缩一次, 会得到一个 tar.gz, 可以直接 load
pigz my-app.tar
# 内网机器
docker load -i my-app.tar.gz
Docker Hub
- https://docker.m.daocloud.io
- https://dockerpull.org
- https://dockerproxy.net
- https://ghcr.nju.edu.cn
- https://ghcr.dockerproxy.net
vim /etc/docker/daemon.json
# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://<my-docker-mirror-host>"]
}
K3s
- https://docs.k3s.io/installation/private-registry
- https://docs.k3s.io/installation/registry-mirror
- https://forums.truenas.com/t/allow-specify-registry-mirrors-or-proxies-in-etc-docker-daemon-json/13068
vim /etc/rancher/k3s/registries.yaml
# /etc/rancher/k3s/registries.yaml
mirrors:
"docker.io":
endpoint:
- "https://docker.m.daocloud.io"
- "https://dockerpull.org"
- "https://dockerproxy.net"
"ghcr.io":
endpoint:
- "https://ghcr.nju.edu.cn"
- "https://ghcr.dockerproxy.net"