Remove a Docker Image After Running It

docker run --rm image-name

Sometimes when running a docker container you may need to delete it after it's completed running. This is pretty simple to accomplish, when you run your docker container you can simply add the flag --rm to your command like so:

docker run --rm image-name

And the docker container has completed it will be removed :)

BETA Snippet explanation automatically generated by OpenAI:

No explanation generated yet.

Snippet By Dev Dojo

·

Created June 12th, 2021

·

Report Snippet