docker - 如何将 docker 镜像从私有(private)第三方注册表迁移到 Google Artifactory 注册表?

标签 docker google-cloud-platform containers artifactory google-artifact-registry

我希望将 docker 镜像从第三方注册表复制到谷歌云的 Artifactory 注册表,因为谷歌不支持第三方私有(private)注册表。在这里Docs

我设法从神器(第三方)中提取图像,然后将其推送到谷歌云的神器注册表。

有没有更好的方法?

最佳答案

Google Artifactory 注册表文档有一个关于 migrating artifacts from a third-party registry 的页面。 .

在其中,他们建议使用 gcrane是 google 开发的 crane 命令行实用程序的扩展,用于管理容器,并具有特定于 gcr.io 的扩展。

来自artifact registry docs :

The gcrane tool helps you with the copying process.

Create a text file images.txt in Cloud Shell with the names of the images you identified. For example:

ubuntu:18.04
debian:buster
hello-world:latest
redis:buster
jupyter/tensorflow-notebook

Download gcrane.

github.com/google/go-containerregistry/cmd/gcrane

Create a script named copy_images.sh to copy your list of files.

#!/bin/bash

images=$(cat images.txt)

if [ -z "${AR_PROJECT}" ] then
    echo ERROR: AR_PROJECT must be set before running this
    exit 1
fi

for img in ${images} do
    gcrane cp ${img} LOCATION-docker.pkg.dev/${AR_PROJECT}/${img}
done

Replace LOCATION with the region or multi-region of your repository.

Make the script executable:

chmod +x copy_images.sh

Run the script to copy the files:

AR_PROJECT=${PROJECT}
./copy_images.sh

这些文档提供了有关识别工作流程中所需的图像、验证权限以及更新 list 、成本等的额外指导。

关于docker - 如何将 docker 镜像从私有(private)第三方注册表迁移到 Google Artifactory 注册表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72310120/

相关文章:

docker - 选择适当的Docker基本镜像

docker - 部署堆栈后将服务添加到堆栈

linux - Docker 容器中 GUI 应用的 X11 转发

python - 通过 2d/3d 坐标访问内容的容器

javascript - 动态元素上的 CSS 破坏了布局

docker - Traefik 作为 Docker 容器与主机网络的代理

docker - 如果一群人完全停止了,docker服务配置或 secret 会怎样?

google-cloud-platform - 适用于 HTTP/HTTPS 的 GCE(Google 计算引擎),支持 IPv6,但不支持 SSL 卸载

java - 无法从 App Engine flex Java 上的不同项目连接到 Cloud SQL

google-cloud-platform - Dataprep 将具有不同列数的文件导入到数据集中