Reputation: 343
I have pulled an image from the docker hub. I want to modify the docker file for this image. Where is the docker file located on my Machine? Thanks.
Upvotes: 8
Views: 28268
Reputation: 29
I'm not sure if this helps, I'm a noob in this. Pulling an image alone is going to download the image alone, without the supplementary files. If you need those, please go to the Github webpage where the image is (if you got it from Github), then push clone or download button on the right. If you have no access to webpages (on a VM for instance), install 'developer tools' and then write 'git clone ' where is the link that appears after pressing clone or download. If you check the directory where you cloned the link, you'll find all the files you need.
Upvotes: 1
Reputation: 57470
The Dockerfile isn't on your machine. Once the image is built, it exists independently of the Dockerfile, just like a compiled C program doesn't need its source code kept around to function. You can partially recover the Dockerfile via the docker history
command, but this won't show you files added with ADD
or COPY
, and various "image squishing" programs can further obfuscate things. The recommended way to get an image's Dockerfile is to go to the repository from which the image was built (hopefully linked from the image's Docker Hub page). If there's no public repository, you're out of luck.
Upvotes: 8