Should docker run use the --rm flag instead of requiring an explicit docker rm command later?

  • Steve Hoffman
  • Mar 3 2019
  • Will not implement
  • Attach files
  • Steve Hoffman commented
    March 03, 2019 16:55
    The documentation [here]( requires you to explicitly run `docker rm` to remove the exited container. If `--rm` flag is added to the `docker run` command, the container will cleanup when it exits. I don't know if this conflicts with the `--restart` flag, but since all state is kept in volume bind mounts, it doesn't seem like this extra step is needed. Can't test it myself as I'm still waiting on my invite code :(
  • Robin Slot commented
    March 24, 2019 17:22
    Won't that also remove the container when you temporarely want to stop and start the container, or on reboot?
  • Admin
    Brandon Iglesias commented
    April 03, 2019 16:16

    Hey Steve & Robin,

    It will remove the container which is not ideal because then you also lose the logs. We want our users to be able to inspect it when it stops.

    Steve your invitation should be coming soon!