How to stop a container dying at the end of an execution?
Option --rm tells Docker explicitly to remove the container after the (main) command finished. Just leave it out.

Note that none of the examples contain this option; they only use it for -help.

As an alternative (which lets you keep --rm), you can tell Docker to mount a volume at /root. Volumes persist after the containers mounting them go away, so you can access the data written there. However, for your purposes here, a simple bind mount is quite enough; add

-v .:/root


to have it write the output file to the current (host) directory. You may have to adjust this if /root is used heavily; you probably want to use a previously empty directory on both sides.