简体   繁体   中英

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 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?

Run with sudo command.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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