When testing with docker, I don't see any functional differences between the following two commands:
docker run --rm -it ubuntu:18.04 bash docker run -it ubuntu:18.04 bash
By differences, I mean that the docker container started without the '--rm' doesn't show up in 'docker container ls' or 'docker container ps' after I exit the terminal. Is it necessary to use the --rm option when attaching to an terminal with the -it option? Is there a corner case that I'm not understanding where the --rm is required to clean up the container?
Apologies if this has been asked before. Seems like a simple enough question, but I had a tough time tracking down a related post. Thanks in advance for the help!