-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintain a running container #3214
Comments
@akanksha-atrey the container will run the command ("echo starting container") and exit as soon as it finishes, so it will not run any other commands, you can try something like |
@LombardiDaniel thanks! That is what I have been doing but it is a hacky solution. I was hoping there was an alternative. |
This solution might work, put the script that I'm using will stuck on that part also until I terminate it manually with container = client.containers.run(
my_img,
command=["tail", "-f", "/dev/null"],
device_requests=[
docker.types.DeviceRequest(device_ids=["0"], capabilities=[['gpu']])
],
tty=True,
detach=True
) |
I am trying to start/run a container and pass commands consecutively. However, as soon as I run the container, it exits and no other exec_run() commands go through. The specific error message is as follows:
The code is as follows:
I am running version 6.1.3 on Python 3.11.5.
The text was updated successfully, but these errors were encountered: