[英]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.