| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
image-transfer 是一个docker镜像迁移工具,用于对不同镜像仓库的镜像进行批量迁移。
tcr镜像迁移工具具有两种运行模式:
image-transfer现在支持OCI镜像格式的同步,包括:
在releases页面可下载源码以及二进制文件
git clone https://github.com/tkestack/image-transfer.git
cd ./image-transfer
# 编译
make./image-transfer -h设置镜像鉴权配置文件为 registry-secret.yaml,镜像迁移仓库规则文件为 transfer-rule.yaml,默认迁移目标为腾讯云 TCR 个人版:ccr.ccs.tencentyun.com,默认 namespace 为 default,并发数为 5,
./image-transfer --securityFile=./registry-secret.yaml --ruleFile=./transfer-rule.yaml \
--ns=default --registry=ccr.ccs.tencentyun.com --routines=5 --retry=3打开ccr迁移模式 ccrToTcr=true, 设置镜像仓库鉴权配置文件为 registry-secret.yaml,腾讯云 API 调用密钥配置文件为 tencentcloud-secret.yaml,默认个人版及企业版实例所在地域均为 ap-guangzhou(广州) TCR 企业版实例示例名称为 image-transfer, 并发数为 5,失败重试次数为 3
./image-transfer --ccrToTcr=true --securityFile=./registry-secret.yaml --secretFile=./tencentcloud-secret.yaml \
--tcrName=image-transfer --tcrRegion=ap-guangzhou --ccrRegion=ap-guangzhou --routines=5 --retry=3同步OCI镜像:
./image-transfer --securityFile=./registry-secret.yaml --ruleFile=./transfer-rule.yaml \
--routines=5 --retry=3如需迁移至腾讯云容器镜像服务内,需配置腾讯云 API 调用密钥,可前往 控制台-访问管理-访问密钥-API密钥管理 获取密钥对。如果在同账号下将 TCR 个人版数据迁移至企业版实例内,可共用同一套密钥。
ccr:
secretId: xxx
secretKey: xxx
tcr:
secretId: xxx
secretKey: xxx配置源目标及迁移目标镜像仓库的访问凭证,即 Docker Login 所使用的用户名,密码。
ccr.ccs.tencentyun.com:
username: xxx
password: xxx
insecure: true
image-transfer.tencentcloudcr.com:
username: xxx
password: xxx
registry.hub.docker.com:
username: xxx
password: xxx
registry.cn-guangzhou.aliyuncs.com:
username: xxx
password: xxx
acr.cn-guangzhou.cr.aliyuncs.com:
username: xxx
password: xxx配置镜像迁移规则,即镜像仓库,镜像版本在源目标及迁移目标内的映射关系。
注:目前只支持 repo、tag 级别,且可同时配置多条镜像迁移规则。
## tag
demo-ns/nginx:latest : image-transfer.tencentcloudcr.com/demo-ns/nginx:latest
## repo
registry.hub.docker.com/{ns1}/{repo1}: image-transfer.tencentcloudcr.com/{ns1}/{repo1}
registry.hub.docker.com/{ns2}/{repo2}: image-transfer.tencentcloudcr.com/{ns2}/{repo2}如果遇到OCI镜像同步问题,可以尝试:
| Back | FazBrowse Home | New Git URL |