Reputation: 4172
I have a python script that loads my db with a bunch of data and thus takes a long while for it to run. Because of this if I run...
$ docker exec -d CONTAINER python /path/to/myscript.py
Was curious if it is possible to run
$ docker exec -it CONTAINER /bin/bash
$ root@container-hash /# ps -ax
And see if that process is still running?
Upvotes: 0
Views: 1213
Reputation: 6477
You can connect to your docker container via exec
as long as the python script has not finished yet. When it is done, the container will be stopped and you can't connect any more.
As long as it is running, you can use docker logs CONTAINER
to show the output of your container, if any.
Upvotes: 1