Docker Community Forums

Share and learn in the Docker community.

Use case for docker image rm --no-prune


#1

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

Regards,Anuraag


#2

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


#3

Hello,
Thanks for the clarification.

Regards,ac