I'm trying to create one Docker container using Docker Python SDK, and keep executing some commands in it and get some results.
I found in docs that I can run the container execute a command and then this container is gone
import docker
client = docker.from_env()
client.containers.run('alpine', 'echo hello world')
or create a container and make it run as daemon
container = client.containers.run('bfirsh/reticulate-splines',
detach=True)
but still I don't know how to keep the container running and send it commands to execute, Is this possible? or Am I missing something? or Am I misunderstand something?