Create Dockerfile From Image

If you have a docker image and don’t have the Dockerfile used to create the image, dfimage can help you re-create Dockerfile. To find information about an image, you can use the command “docker history IMAGE_ID”. History command will show all actions taken on the image, including the commands used. You can use this information to reverse engineer and create the missing Dockerfile.

There is a tool for automating this task, it is called dfimage. It is available on the docker hub.

https://hub.docker.com/r/laniksj/dfimage

To use it, run

In the above command, replace IMAGE_ID with image ID of the docker image for which you need Dockerfile created.

Example

See Docker

Leave a Reply

Your email address will not be published. Required fields are marked *