Run and remove container using the --rm flag
$ docker run --rm busybox echo hello world
After the above command finished check it:
$ docker container ls -a
The container was not left around.
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
--rm flag$ docker run --rm busybox echo hello world
After the above command finished check it:
$ docker container ls -a
The container was not left around.