Where is the dockerfile when I do a docker pull?

I did a docker pull on successfully and can see it’s listed in docker images.
However, I can’t build it because there’s no dockerfile in the current directory (where I issued the docker pull).
So, where does docker pull store the image?

I’m basically trying to do what’s mentioned in GitHub - sequenceiq/docker-spark

Where are Docker images stored? - Lounge Scene says it should be in /var/lib/docker.
In Docker for Mac, what does that map to?

To answer the question in the subject line: the Dockerfile isn’t part of the image, and docker pull (or docker push) don’t know about it.

They’re stored in a somewhat hidden virtual machine, maybe even in /var/lib/docker within that, but the path on the Mac host is pretty obscured; it’s under your home directory.

Are you running the docker build command from the top of a git clone of that repository?

If you’ve docker pulled the referenced image already, do you actually need to rebuild it?

2 Likes

Thank you @dmaze, I did a git clone.

FYI for my docker desktop on my mac the images go to:
/Users/(USERNAME)/Library/Containers/com.docker.docker/Data/vms/0/data/