I am not much of a docker expert but i managed to start my python scirpt in a docker bash. After connection errors with the network I loose my connection to the ubuntu server where the docker is running on. After reconnect to the server, I can still connect to the docker container which is still running, but I am not able to connect to the bash where my Python script is running in. So, how to reconnect to the docker containers bash where my script is running in, to see its progress?
0
votes
Docker doesn't do anything special here, so it's the same way you'd address the problem if you were running the program directly on the host. Doing extensive work in a container shell isn't usually a best practice, especially since any changes to the container filesystem will get lost as soon as the container is deleted.
- David Maze
2 Answers
1
votes
1
votes
as a general rule there is no way to "recover" a lost bash session.
A workaround could be to run a script inside a terminal multiplexer like screen or tmux, which allows you to attach / recover the session from multiple terminals.
I fear the current process is gone, you can only check the logs using docker logs, but chances are your job died with your session (unless you nohuped it).