There is the following code:
import docker
client = docker.from_env()
container = client.containers.create("ubuntu", stdin_open=True)
container.start()
container.stop()
The option stdin_open
must be set to True
. The stop
operations takes 10 seconds to execute (it sends SIGTERM first, if it fails then after 10 seconds it sends SIGKILL). So it looks that SIGTERM is ignored. How to stop the container gracefully with stdin_open
set to True
?