Docker_Registry_V1_to_V2灵雀云迁移实践.pdf

Docker Registry V1 to V2 —— 灵雀云迁移实践 刘梦馨 灵雀云软件工程师 • Docker, Image, Registry, Hub • V1 Python Registry • V2 Golang Distribution • 灵雀云同步实践 • Alauda hub What is Docker? Docker, Image, Registry, Hub • Pull image • Run image • Build image • Push image What is Image? • 程序 VS 进程 • 分层文件系统 • 镜像共享 layer What is Registry? A central place to store and distribute docker images • 存储镜像文件及其 meta • 提供上传下载服务 • 提供对外 API 服务 • 源代码和 git 仓库的对应关系 What is Hub? • Git to Github • UI • User Auth • Public, Private, Organization • Webhooks, search, comment … • Dockerhub is **Not** open sourced V1 Python Registry **Deprecated* /docker/docker-registry V1 的问题 • 安全 • 随机 image id • 无法对内容进行校验 • 无法确定 layer 来源 • 性能 • 随机 id 重复 push • metadata-layer-metadata-layer • Python 实现 • 其他 • Tag 可变,版本难以跟踪 V2 Golang Distribution /docker/distribution Digest • 内容可检验 • 算法可插拔 • Cache 友好 • Digest 服务器端计算 • 取代 tag 概念 Manifest • 包含所有 layer 信息 • Signature 强化校验 • V1 兼容信息 • 性能 • Go 实现 • 并行 pull 其他 • 新的 auth 机制 • 后端存储插件化 • Notification 机制 • 全新的 API 存在问题 • API 缺失 • Delete, search, info • Push/Pull 速度待提高 • 镜像格式和 V1 **不兼容** V1 和V2 共存及同步 现状 • =1.6 v1,v2 1.6 v1 • 用户所使用客户端版本不统一(0.9~1.8 ) • 用户使用客户端可能变化 • 自有平台 docker 版本的兼容 V1 V2 共存 • Nginx 针对不同 url 分别转发 • Docker 1.6+ 首先尝试 v2 ,失败会退到v1 • Docker 1.5 v2 支持不完善 V1 V2 同步 • • 原理: docker 1.6 pull

文档评论(0)

1亿VIP精品文档

相关文档