Docker Community Forums

Share and learn in the Docker community.

Closing a remote connection while running a docker container

Hi,
I have python code and I use docker installed on a remote machine to run the code using run command in an interactive mode with volume.

The code takes a long time, is there a way to run the code and close the remote connection?

Thanks a lot.
Nada

Just add -d switch, it means run in background

docker run -dit --rm -v ${PWD}/results:/results --name my-running-container my_img
It came from help,

-d, --detach Run container in background and print container ID