本页面上的部分或全部信息可能不适用于 Trusted Cloud by S3NS。
排查容器映像问题
了解在 Artifact Registry 中管理容器映像时可能有助于进行排查的问题排查步骤。
无法拉取映像或部署到 Trusted Cloud by S3NS 运行时环境
请检查以下各项:
- 验证您要推送的映像的完整路径是否正确。路径必须包含注册表主机名、 Trusted Cloud by S3NS、项目 ID、代码库和映像。例如:
u-france-east1-docker.s3nsregistry.fr/my-project/my-repo/my-image:v1
如需了解详情,请参阅代码库和映像名称。
- 验证拉取映像的账号是否具有从代码库读取的正确权限。如果您停用了向服务账号自动授予角色,则必须向运行时服务账号授予工件注册表角色。
- 对于 Compute Engine 和 Google Kubernetes Engine 服务账号,您必须向运行时服务账号授予 Artifact Registry 读取者角色 (
roles/artifactregistry.reader
)。
- 如果您使用的是 Docker 或其他第三方工具,则必须满足以下条件:
- 向与代码库交互的账号授予权限。
- 配置客户端以对代码库进行身份验证。
无法将映像推送到 Artifact Registry
请尝试以下操作:
- 验证您要推送的映像的完整路径是否正确。路径必须包含注册表主机名、 Trusted Cloud by S3NS 项目 ID、代码库和映像。例如:
u-france-east1-docker.s3nsregistry.fr/my-project/my-repo/my-image:v1
每个 Artifact Registry 代码库都是一个单独的资源,因此您无法将映像推送到没有代码库的路径。例如,u-france-east1-docker.s3nsregistry.fr/my-project/my-image:v1
是无效的图片路径。
如需了解详情,请参阅代码库和映像名称。
- 验证推送映像的账号是否具有写入代码库的权限。如果您停用了向服务账号自动授予角色,则必须向运行时服务账号授予工件注册表角色。
- 对于 Compute Engine 和 Google Kubernetes Engine 服务账号,您必须向运行时服务账号授予 Artifact Registry Writer 角色 (
roles/artifactregistry.writer
)。
- 如果 Artifact Registry 返回消息
The repository has
enabled tag immutability
,则表示为代码库配置了标记不可变性。您无法推送标记已用于仓库中同一图片的其他版本的图片。请尝试使用未被其他存储的图片版本使用的标记再次推送图片。
如需验证仓库是否已配置为使用不可变的映像标记,请查看 Trusted Cloud 控制台中仓库列表中的不可变的映像标记列,或运行以下命令:
gcloud artifacts repositories describe REPOSITORY \
--project=PROJECT-ID \
--location=LOCATION
ImagePullBackOff 和 ErrImagePull 消息
包含 ImagePullBackOff
和 ErrImagePull
的消息表示 GKE 无法从注册表中拉取映像。
- 请验证从 Artifact Registry 拉取的要求。
- 请参阅 GKE 文档中的映像拉取问题排查部分。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-08。"],[[["This page provides troubleshooting steps for managing container images in Artifact Registry, specifically addressing issues related to pulling and pushing images."],["When encountering problems pulling an image, ensure the image path is correct and that the pulling account has the necessary Artifact Registry Reader permissions."],["If you are unable to push an image, confirm that the repository exists, the image path is correct, and the account has the appropriate Artifact Registry Writer permissions."],["Tag immutability, when enabled, prevents pushing images with tags already in use by other versions of the same image, and checking the repository's configuration can help to fix this."],["If you encounter `ImagePullBackOff` or `ErrImagePull` messages, you need to check the required permissions and then review the troubleshooting steps in the GKE documentation."]]],[]]