我正在使用 shippable 将私有 docker 图像推送到 Google Container Registry,然后我想从笔记本电脑本地或 Google Compute Engine 上的实例中提取该镜像。
我知道该命令gcloud preview docker pull gcr.io/projectID/image-name
有效,但我不能依赖 gcloud 安装在有人可能需要从中提取图像的每台机器上。
如果我docker-compose up -d
在我的机器上运行,则会收到以下错误:
Pulling image gcr.io/projectID/image-name...
Pulling repository gcr.io/projectID/image-name
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 464, in up
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.project", line 208, in up
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.service", line 214, in recreate_containers
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.service", line 199, in create_container
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.progress_stream", line 37, in stream_output
File "/compose/build/docker-compose/out00-PYZ.pyz/compose.progress_stream", line 50, in print_output_event
compose.progress_stream.StreamOutputError: Error: Status 403 trying to pull repository projectID/image-name: "Access denied."
有没有办法使用某种形式的 OAuth 或密钥来验证或访问图像?我想避免必须在每台需要提取图像的机器上安装 gcloud,并且图像必须保持私有。
我已经尝试过gcloud preview docker -a
,但这不是我正在寻找的解决方案。
预先感谢您的任何帮助。