V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ysmood
V2EX  ›  程序员

国内有 ghcr.io 的镜像加速吗?

  •  
  •   ysmood ·
    ysmood · 2021-08-31 15:43:36 +08:00 · 7120 次点击
    这是一个创建于 969 天前的主题,其中的信息可能已经有所发展或是发生改变。

    类似 https://hub-mirror.c.163.com 这种的免费服务有吗?

    11 条回复    2021-09-01 16:21:22 +08:00
    Jays
        1
    Jays  
       2021-08-31 15:49:19 +08:00
    貌似没有,hassio 更新都会被 ghcr.io 卡死。。。。。。
    ysicing
        2
    ysicing  
       2021-08-31 16:38:25 +08:00
    可以自己搭建一个 proxy
    Mitt
        3
    Mitt  
       2021-08-31 16:45:06 +08:00
    docker 的 mirror 仅适用于隐式的比如 hub.docker.io ,所以这种第三方的都很少有 mirror,连 k8s 的镜像国内都很难办,得直接改每个镜像地址还得有专门的反代才行
    offswitch
        4
    offswitch  
       2021-08-31 17:12:39 +08:00
    @Mitt 如果 docker 能支持就好了,没有网址或者 ip 为前缀的,根据 daemon.json 中配置的 registry 顺序查找。
    Mitt
        5
    Mitt  
       2021-08-31 17:30:08 +08:00
    @offswitch 没有网址和前缀的是因为隐性的有个前缀叫 hub.docker .io (以下叫 A 域名, V2EX SPAM 警告了),并不是真的没有,所以才不支持的,比如 xxx/yyy 实际上是 [A 域名]/xxx/yyy 当你有 registry 的时候它会请求 [B 域名]/xxx/yyy,这时候 [B 域名] 其实是反代的 A 域名 来实现
    XiLingHost
        6
    XiLingHost  
       2021-08-31 17:30:27 +08:00
    @offswitch 可以试试用 artifactory 或者 nexus 的聚合仓库做 mirror
    Latin
        7
    Latin  
       2021-08-31 17:44:07 +08:00
    offswitch
        8
    offswitch  
       2021-08-31 20:08:04 +08:00
    @Mitt 这个我知道,我的意思是,如果 daemon.json 里面配置了 registry,那么就按照 daemon.json 中 registry 顺序查找,而不是使用 docker.io 的。实际上这个大概率跟 docker 的商业策略有关,不是实现不了,而且 docker 要赚钱那
    Mitt
        9
    Mitt  
       2021-08-31 21:20:30 +08:00 via iPhone
    @offswitch 你还是没理解,你说的这个功能本身就有
    MoeMoesakura
        10
    MoeMoesakura  
       2021-08-31 21:26:24 +08:00
    CF Worker 自己搭反向代理?
    cloverzrg2
        11
    cloverzrg2  
       2021-09-01 16:21:22 +08:00
    自己部署一下加速器试试。部署 registry 镜像,使用下面这个配置文件,把 proxy.remoteurl 改为 ghcr.io 的地址,试试
    ```
    version: 0.1
    log:
    level: info
    formatter: text
    fields:
    service: registry
    accesslog:
    disabled: false
    storage:
    cache:
    blobdescriptor: inmemory
    filesystem:
    rootdirectory: /data
    http:
    addr: :5000
    headers:
    X-Content-Type-Options: [nosniff]
    proxy:
    remoteurl: https://registry-1.docker.io
    health:
    storagedriver:
    enabled: true
    interval: 10s
    threshold: 3
    ```
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5187 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 09:36 · PVG 17:36 · LAX 02:36 · JFK 05:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.