docker_practice/install/mirror.md

113 lines
4.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#
Docker Hub
* [( -> () -> -> -> )](https://cr.console.aliyun.com/cn-hangzhou/instances)
* [ `https://hub-mirror.c.163.com`](https://www.163yun.com/help/documents/56918246390157312)
* [ `https://mirror.baidubce.com`](https://cloud.baidu.com/doc/CCE/s/Yjxppt74z#%E4%BD%BF%E7%94%A8dockerhub%E5%8A%A0%E9%80%9F%E5%99%A8)
** [docker-practice/docker-registry-cn-mirror-test](https://github.com/docker-practice/docker-registry-cn-mirror-test/actions) 查看。**
> Docker Docker
[](https://www.163yun.com/) 镜像服务 `https://hub-mirror.c.163.com` 为例进行介绍。
## Ubuntu 16.04+Debian 8+CentOS 7+
Linux 使 [systemd](https://systemd.io/) 进行服务管理,这里介绍如何在使用 systemd 的 Linux 发行版中配置镜像加速器。
`docker.service`
```bash
$ systemctl cat docker | grep '\-\-registry\-mirror'
```
`$ systemctl cat docker` `ExecStart=` `--registry-mirror`
`/etc/docker/daemon.json`
```json
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
]
}
```
> json Docker
```bash
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
```
## Windows 10
使 `Windows 10` Docker `Settings` `Docker Engine` json `Apply & Restart` Docker
```json
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
]
}
```
## macOS
使 macOS Docker Desktop -> `Settings...` `Docker Engine` json `Apply & restart` Docker
```json
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
]
}
```
##
`$ docker info`
```bash
Registry Mirrors:
https://hub-mirror.c.163.com/
```
## `k8s.gcr.io`
[ ](https://www.aliyun.com/product/acr?source=5176.11533457&userCode=8lx5zmtu&type=copy) **镜像中心** -> **镜像搜索** 查找。
`k8s.gcr.io/coredns:1.6.7` `registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.6.7`
```bash
# $ docker pull k8s.gcr.io/xxx
$ docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/xxx
```
##
* https://dockerhub.azk8s.cn **已转为私有**
* https://reg-mirror.qiniu.com
* https://registry.docker-cn.com
**watch** [](https://github.com/docker-practice/docker-registry-cn-mirror-test) 这个 GitHub 仓库,我们会在此更新各个镜像地址的状态。
##
**** 访 Docker
* [Azure `https://dockerhub.azk8s.cn`](https://github.com/Azure/container-service-for-azure-china/blob/master/aks/README.md#22-container-registry-proxy)
* [ `https://mirror.ccs.tencentyun.com`](https://cloud.tencent.com/act/cps/redirect?redirect=10058&cps_key=3a5255852d5db99dcd5da4c72f05df61)