I would like to be able to pull a docker image from dockerhub and edit the dockerfile.. I am wondering if dockerhub actually downloads the dockerfile to the localhost and to where it is stored (I am running it from a MAC).
2 Answers
An image does not include a complete Dockerfile. When pulling an image you get an image manifest along with the required file system layers.
You can see some of the build steps with docker history --no-trunc IMAGE
but it's not the complete Dockerfile.
There are utilities that try and generate a Dockerfile from the image history

- 68,711
- 7
- 155
- 158
You dont download the docker image and edit their Dockerfile. The Dockerfile is an instruction set on how to build an image. Once the image is made, theres no going backwards. However if its on Dockerhub there should be a link to the Dockerfile. Look around at the page for links to the Dockerfile. Probably just a link to Github.
Once you have the dockerfile you then build it. For instance if you have a terminal open in the same folder as a Dockerimage file you could run
docker build -t myimage .
where myimage
is the tag of your image. You will then have an instance of myimage on your local machine.
Also you can make a docker file that extends theres using FROM
. For instance your docker file might start with
FROM java:6b38-jdk
# append to their image.

- 11,267
- 2
- 35
- 52