找了有两个开源项目比较不错,都可以完成镜像的迁移。
crpy 的使用
crpy 使用 python 开发,有本地缓存,拉取和推送镜像速度比较快。使用体验比较接近 docker。
开源地址: https://github.com/bvanelli/crpy
安装
# 也可以安装到虚拟环境 |
认证
crpy login registry.cn-hangzhou.aliyuncs.com -u <username> -p <password>
|
认证信息存储在:~/.crpy/config.json
拉取镜像
crpy pull nginx:1.29 nginx_1.29.tar.gz
|
缓存数据存储在:~/.crpy/blobs
推送镜像
crpy push nginx_1.29.tar.gz registry.cn-hangzhou.aliyuncs.com/iuxt/nginx:1.29
|
crane 的使用
这个工具是 Golang 写的,支持 Windows,单文件直接运行,比较方便。
https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md
安装
在:https://github.com/google/go-containerregistry/releases 下载二进制文件即可。
认证
crane auth login registry.cn-hangzhou.aliyuncs.com -u <username> -p <password>
|
认证信息存储在:~/.docker/config.json
拉取镜像
crane pull nginx:1.27 nginx_1.27.tar
|
推送镜像
crane push .\nginx_1.27.tar registry.cn-hangzhou.aliyuncs.com/iuxt/nginx:1.27
|
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
