Docker Image edit

Hi guys,
how can I edit a Docker IMAGE, after I have already generated by Dockerfile?
Is it possible ever after?
Is there a command in Linux?

Thanks

Edit the Dockerfile and docker build a new image. Depending on what you’re changing and how your Dockerfile is laid out, the build step might be able to skip (reuse) many of the earlier steps (layers); as a corollary, structuring the Dockerfile so that the things that are most likely to change will be at the end will result in faster rebuilds.

You can also run the image, execute bash in an interactive session (that means the main image needs to have Bash installed)
docker exec -it mycontainer bash
Then do your modifications like removing file, installing packages,…
Then you can commit the container as a new image
See this tutorial for full explanation
https://docs.docker.com/engine/tutorials/dockerimages/

1 Like