use --detach only on docker run

This commit is contained in:
clore 2024-12-29 23:22:40 +00:00
parent bce71c4574
commit 73cb1ca67e
1 changed files with 5 additions and 1 deletions

View File

@ -13,7 +13,11 @@ def create_container(container_options, ip=None, docker_gpus=False, shm_size=64,
# Sanitize and validate input
container_options = sanitize_input(container_options)
command = ["docker", ("create" if paused else "run"), "--detach", "--tty"]
command = ["docker", ("create" if paused else "run")]
if not paused:
command.append("--detach")
command.append("--tty")
if "name" in container_options:
command.extend(["--name", container_options["name"]])