How to remove Docker container after output is pushed?

I am using a DockerOperator with xcom_push set to True, so that I can grab the console output of the Docker container and email it. However, this spawns a new Docker container every time the DAG is triggered. If I set auto_remove to True, then the container is cleaned up, but it appears that the clean up happens before the Xcom push, so I get an exception about the Xcom failing.

How can I get the container to be pruned after the Xcom push happens?

Source: StackOverflow