docker
  • Introduction
  • 安装
  • 存储驱动选择
  • Dockerfile
    • 前台运行
  • Registry
    • notification
    • auth
      • token认证的设计
    • API
      • pull镜像
      • push镜像
  • 镜像存储
    • 本地存储
    • Registry中的存储
    • 如何判断两个镜像是否是同一个
  • 下载google镜像
  • Docker设置代理
  • 日志
Powered by GitBook
On this page
  • docker-proxy(推荐)
  • github.com/anjia0532
  • 阿里云镜像仓库

Was this helpful?

下载google镜像

Previous如何判断两个镜像是否是同一个NextDocker设置代理

Last updated 5 years ago

Was this helpful?

通过以下的URL浏览google的docker镜像

直接使用docker命令去下载google上的镜像一般都会失败,除非你的主机是在境外。我们可以尝试以下方法。

docker-proxy(推荐)

如果你有一个代理服务器,能翻墙,那么可以为docker-daemon设置代理。docker-daemon在启动的时候会检查环境变量http_proxy与https_proxy以及no_proxy,如果docker-daemon启动后再设置这些环境变量,是没有用的。

设置这三个环境变量有几种方法:

  • 全局设置

    在/etc/profile中设置

  • 只为docker-daemon服务设置

在docker.service文件中添加Environment这样的一行,参考

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

github.com/anjia0532

github上有人把google的镜像备份到了docker_hub上,镜像名字的映射规则与下载方法参考:

不过,从他这上面下载的镜像,镜像的digest与google官方镜像的digest会不一样,container_id是一样的

阿里云镜像仓库

阿里云的镜像仓库会同步google中的镜像,比如google的镜像名映射到阿里云的镜像规划为

k8s.gcr.io/<image>:<tag> -> registry.cn-hangzhou.aliyuncs.com/google_containers/<image>:<tag>

https://console.cloud.google.com/gcr/images/google-containers?project=google-containers
https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
https://github.com/anjia0532/gcr.io_mirror
https://dev.aliyun.com/search.html