rambutan
rambutan

Reputation: 389

Reconnect to running bash in Docker Container

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?

Upvotes: 0

Views: 1113

Answers (2)

Cavaz
Cavaz

Reputation: 3119

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).

Upvotes: 1

Koko Jumbo
Koko Jumbo

Reputation: 313

use docker logs (documents) *you will not be able to use to end the python this way

Upvotes: 1

Related Questions