我想将我的Gitlab注册表移到Azure容器注册表
我找到了从非Azure私有容器注册表导入这个命令,但是它是针对单个映像的,而不是整个注册表
az acr import \
--name myregistry \
--source docker.io/sourcerepo/sourceimage:tag \
--image sourceimage:tag \
--username <username> \
--password <password>是否有办法同时移动所有注册表图像?
发布于 2022-01-20 08:33:52
请检查下面的命令是否能给出解决问题的方法:
这里,尝试使用Azure命令az acr repository list和az acr repository show-tags在循环中包含图像标记。
(我们可以在开始时启动登录 )
SOURCE_REGISTRY=myregistry
TARGET_REGISTRY=targetregistry
# Get list of source repositories
REPOS = $(az acr repository list \ --name $SOURCE_REGISTRY --output tsv)
# Enumerate tags and import to target registry
for repo in $REPOS; do
TAGS= $(az acr repository show-tags --name $OURCE_REGISTRY --repository $repo --output tsv);
for tag in $TAGS; do
echo "Importing $repo:$tag";
az acr import --name $TARGET_REGISTRY --source $SOURCE_REGISTRY /$repo":"$tag --username <username> --password <password> ;
done
done或Azure PowerShell等价物,如参考:Microsoft和几乎类似于堆栈溢出线程
参考资料:
https://stackoverflow.com/questions/70768750
复制相似问题