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
I’m trying to run docker at the moment from the python api. I’m just trying to make a container and then run commands using the exec_run command, however, my container seems to exit immediately after using the following:
I’ve tried to add in a pause command with the following:
container=client.api.create_container(image_selected, command="while true; do sleep 10000000; done")
and this doesn’t have any effect and the container still exits immediately.
I don’t suppose you would have any idea on how to troubleshoot. As far as I’m aware there are no errors that are outputted.
Here is the terminal output. I tried to use container.start() 2 times so that is why there are 3 of the initial messages:
Do you have any ideas?
The text was updated successfully, but these errors were encountered:
seems to be the problem with the image
the only way I found to make it run is by changing the entrypoint. using entrypoint + command also doesn't work
executing the original entrypoint from interactive mode is working tho. look at image below
I’m trying to run docker at the moment from the python api. I’m just trying to make a container and then run commands using the exec_run command, however, my container seems to exit immediately after using the following:
import docker
from docker.types import Mount
import os
client = docker.from_env()
source_directory = "C:\Users\usr\data"
target="/data"
volume=os.getcwd() + "/data"
image_selected='openfoam/openfoam7-paraview56'
container=client.api.create_container(image_selected)
container=client.containers.get(container['Id'])
print(container)
container.start()
I’ve tried to add in a pause command with the following:
container=client.api.create_container(image_selected, command="while true; do sleep 10000000; done")
and this doesn’t have any effect and the container still exits immediately.
I don’t suppose you would have any idea on how to troubleshoot. As far as I’m aware there are no errors that are outputted.
Here is the terminal output. I tried to use container.start() 2 times so that is why there are 3 of the initial messages:
Do you have any ideas?
The text was updated successfully, but these errors were encountered: