Docker Community Forums

Share and learn in the Docker community.

Use case for docker image rm --no-prune


How do I use the --no-prune option in docker image rm



It’s useful if intermediate images of the final image stiff have a use.

For example, if you’ve got an image you don’t want to keep, because, say, something systemic broke a docker build command, like a network issue caused the wrong things to get downloaded inside, but you don’t want to lose all the steps up to that point because that take 3 hours to run, you delete the image with --no-prune and re-run the build.

As to how, it’s just docker rmi --no-prune IMAGE


Thanks for the clarification.