Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skopeo (Docker container) sync #66

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Conversation

taoky
Copy link
Member

@taoky taoky commented Dec 19, 2020

Checklist

  • 更新 README

(如果方便的话, 可以简述一下您所做的改动)

ustclug/mirrorrequest#276

尝试使用 skopeo 进行 Docker 镜像同步。

详情:

  • mirrors 本地开一个 registry,通过 nginx 反代 GET/HEAD only 限制外部 push。(如果需要设置密码,registry 就必须配置 TLS,这样的话反代什么的会非常麻烦)
  • yuki 定时启动 skopeo(本 PR 的 skopeo-sync),同步指定的镜像。
  • 镜像列表很长,不适合写在环境变量里。我的想法是就写在配置里面,如果需要增减镜像的话,skopeo-sync/ 下的配置 YAML 也需要更新。

@taoky
Copy link
Member Author

taoky commented Dec 19, 2020

另外如果要上线服务,还需要申请一个新的三级域名(比如说 registry.mirrors.ustc.edu.cn?)。因为尽管 Docker Registry 支持 prefixdocker pull 命令目前却不支持

此外还有一个问题是是否打开 --scope 选项。如果启用的话,获取镜像的命令就类似于:

docker pull example.com/registry.hub.docker.com/library/hello-world:latest

这样不会出现可能的命名冲突,但是看起来比较麻烦,并且没有办法作为 Docker 的 registry-mirrors 的参数。

如果不启用,命令就是:

docker pull example.com/library/hello-world:latest

@zhsj
Copy link
Contributor

zhsj commented Dec 20, 2020

我觉得只同步部分镜像的话,那就不能让用户误设置为registry mirror。

@knight42
Copy link
Member

镜像列表很长,不适合写在环境变量里。我的想法是就写在配置里面,如果需要增减镜像的话,skopeo-sync/ 下的配置 YAML 也需要更新。

可以把配置单独放到一个文件里,然后同步的时候通过 volume 挂载

我觉得只同步部分镜像的话,那就不能让用户误设置为registry mirror。

+1

@taoky
Copy link
Member Author

taoky commented Dec 21, 2020

把 YAML 配置提出来了。另外因为 skopeo sync--all 参数不在最新的稳定 releases 里面,所以如果需要同步非 Linux 和非 x86 的容器的话,还要等到更新的版本发布。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants