简体   繁体   English

从Google Cloud Container Registry中提取Docker映像时权限被拒绝

[英]Permission denied when pulling Docker image from Google Cloud Container Registry

I am getting a permission denied error message when pulling a docker image from the Google Cloud Container Registry, in a Compute Engine VM: 在Compute Engine虚拟机中从Google Cloud Container注册表中提取docker映像时,出现权限拒绝错误消息:

gcloud docker pull -- gcr.io/your-project-id/example-image

Results in: 结果是:

FATA[0000] Post http:///var/run/docker.sock/v1.18/images/create?fromImage=gcr.io%2Fyour-project-id%2Fexample-image%3Alatest : dial unix /var/run/docker.sock: permission denied. FATA [0000]发布http:///var/run/docker.sock/v1.18/images/create?fromImage = gcr.io%2Fyour-project-id%2Fexample-image%3Alatest :拨打unix / var / run /docker.sock:权限被拒绝。 Are you trying to connect to a TLS-enabled daemon without TLS? 您是否要连接到没有TLS的启用TLS的守护程序?

I got the "gcloud docker pull" command from a sample and the docs: https://cloud.google.com/container-registry/docs/pulling 我从示例和文档中获得了“ gcloud docker pull”命令: https ://cloud.google.com/container-registry/docs/pulling

以超级用户身份运行可以达到以下目的:

sudo gcloud docker pull -- gcr.io/your-project-id/example-image

Adding user to docker group worked for me. 将用户添加到docker组中对我有用。 Added benefit is that, after adding the user to docker group, you will not have to use sudo along with docker commands. 额外的好处是,将用户添加到docker组后,您将不必将sudo与docker命令一起使用。

sudo usermod -a -G docker ${USER} sudo usermod -a -G泊坞窗$ {USER}
Note: It requires a machine restart 注意: 需要重新启动机器

Now you can use docker pull 现在您可以使用docker pull
gcloud docker pull -- gcr.io/your-project-id/example-image gcloud docker pull-gcr.io/您的项目ID /示例图像

https://cloud.google.com/container-registry/docs/support/troubleshooting https://cloud.google.com/container-registry/docs/support/troubleshooting

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google容器引擎在从容器注册表中提取图像时遇到问题 - google container engine having problems pulling image from container registry 推送 docker 容器时,Google Container Registry 访问被拒绝 - Google Container Registry access denied when pushing docker container 在 Airflow 2.0 中使用 DockerOperator 从 GitLab 容器注册表中拉取私有 docker 图像时出错 - Error when pulling private docker image from GitLab container registry using DockerOperator in Airflow 2.0 Google Cloud Container Registry拒绝来自docker push的连接 - Google Cloud Container Registry refuses connection from docker push 将 Docker 映像从 GKE 中运行的容器推送到 Google Container Registry - Push a Docker image to Google Container Registry from a container running in the GKE 从谷歌云计算中提取 docker 的权限被拒绝 - Permission denied on docker pull from Google Cloud Compute 从我拥有的存储库中提取 Docker 映像时访问被拒绝 - Access denied when pulling Docker image from a repository I own 通过容器的构建映像拒绝 Docker 权限 - Docker permission denied via build image for container 从GCR导出Docker镜像(Google容器注册表) - Export Docker image from GCR (Google Container Registry) 尝试推送docker容器时,Google容器注册表会拒绝访问 - Google Container Registry gives access denied when trying to push docker container
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM