You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you know its possible to receive a generator from an exec-run. I can print the stream if there is any next item... but when to end, how could I ever know, wether an exec-run has finished?
The text was updated successfully, but these errors were encountered:
this might work, using exec_inspect from low-level API
importdockerclient=docker.from_env()
# Start the exec instanceexec_instance=client.containers.get('my_container').exec_run('ls')
# Check the status of the exec instanceexec_status=client.api.exec_inspect(exec_instance.id).get('Running')
ifexec_status:
print('Exec instance is still running')
else:
print('Exec instance has finished')
you know its possible to receive a generator from an exec-run. I can print the stream if there is any next item... but when to end, how could I ever know, wether an exec-run has finished?
The text was updated successfully, but these errors were encountered: