1

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?

Aviral Srivastava
  • 4,058
  • 8
  • 29
  • 81
  • Where does that image come from? Looking at places like GitHub repositories for a Dockerfile might be a little more reliable than trying to reconstruct it from the built image. – David Maze Nov 29 '20 at 13:11

1 Answers1

1

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
Shashank Sinha
  • 492
  • 2
  • 7