无Docker环境进行容器镜像操作
找了有两个开源项目比较不错,都可以完成镜像的迁移。
crpy 的使用
crpy 使用 python 开发,有本地缓存,拉取和推送镜像速度比较快。使用体验比较接近 docker。
开源地址: https://github.com/bvanelli/crpy
安装
1 | # 也可以安装到虚拟环境 |
认证
1 | crpy login registry.cn-hangzhou.aliyuncs.com -u <username> -p <password> |
认证信息存储在:~/.crpy/config.json
拉取镜像
1 | crpy pull nginx:1.29 nginx_1.29.tar.gz |
缓存数据存储在:~/.crpy/blobs
推送镜像
1 | 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 下载二进制文件即可。
认证
1 | crane auth login registry.cn-hangzhou.aliyuncs.com -u <username> -p <password> |
认证信息存储在:~/.docker/config.json
拉取镜像
1 | crane pull nginx:1.27 nginx_1.27.tar |
推送镜像
1 | crane push .\nginx_1.27.tar registry.cn-hangzhou.aliyuncs.com/iuxt/nginx:1.27 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 杂烩饭!
评论


