{"repo":"LanikSJ/dfimage","free":true,"listed":false,"github":"https://github.com/LanikSJ/dfimage","clone":"git clone https://github.com/LanikSJ/dfimage.git","description":"Reverse-engineer a Dockerfile from a Docker image.","language":"Python","stars":424,"topics":["docker","container"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"🛠️ Dockerfile From Image (dfimage) 📑 Table of Contents - 🎯 Purpose - ⚡ Usage - 🧪 Test - 🐋 Docker Example - 🔍 How Does It Work - ⚠️ Limitations - 🐛 Bugs - 📝 License - 💰 Donate 🎯 Purpose Reverse-engineers a Dockerfile from a Docker image. See my Inspiration and Container Source for more information. Similar to how the docker history command works, the Python script is able to re-create the Dockerfile (approximately) that was used to generate an image using the metadata that Docker stores alongside each image layer. ⚡ Usage The Python script is itself packaged as a Docker image so it can easily be executed with the Docker run command: The ruby:latest parameter is the image name & tag (either the truncated form or the complete image name & tag). Since the script interacts with the Docker API in order to query the metadata for the various image layers it needs access to the Docker API socket. The -v flag shown above makes the Docker socket available inside the container running the script. Note that the script only works against images that exist in your local image repository (the stuff you see when you type docker images ). If you want to generate a Dockerfile for an image that doesn't exist in your local repo you'll first need to docker pull it. You can find more usage examples in the Wiki. 🐍 Alternative: pip install dfimage To install the dfimage package using pip(x), run the following command: Note that Docker must be installed on your system for the dfimage packag","default_branch":null,"files":null,"tree":[],"storefront":"/r/LanikSJ","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/LanikSJ/dfimage/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}