Docker delete container after running

When you run a docker image, it create a container and run it. After docker container stop, container stays, so you can use it again if required.

Some times, you need to delete docker container after it is run. This is useful if your docker container is just a command line executable. In my case, docker container have ffmpeg in it, i don’t want container left over after i executed ffmpeg command.

To auto delete container after execution, use –rm option.

Example

Add a Comment

Your email address will not be published. Required fields are marked *