简体   繁体   English

由于权限被拒绝错误,无法从 Docker 图像创建 Dockerfile

[英]Unable to create Dockerfile from a Docker image due to permissions denied error

I am trying to extract Dockerfile from Docker image.Taking look at a popular answer , I executed the following commands:我正在尝试从 Docker 图像中提取 Dockerfile。看看一个流行的答案,我执行了以下命令:

docker run -v /var/run/docker.sock:/var/run/docker.sock --rm alpine/dfimage -sV=1.36 quay.io/opendatahub/spark-cluster-image:spark24

Got the following error:得到以下错误:

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.36/images/create?fromImage=quay.io%2Fopendatahub%2Fspark-cluster-image&tag=spark24": dial unix /var/run/docker.sock: connect: permission denied

How do I get the corresponding Dockerfile for this image?如何获得此图像对应的 Dockerfile?

Run with sudo command.使用sudo命令运行。

sudo docker run -v /var/run/docker.sock:/var/run/docker.sock --rm alpine/dfimage -sV=1.36 quay.io/opendatahub/spark-cluster-image:spark24

or add permissions或添加权限

If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker your-user

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM