limited-art-78990
08/24/2024, 2:03 PMdocker_image
target as a runnable dependency in adhoc_tool
or shell_command
like so
docker_image(
name = "image",
)
shell_command(
name = "foo",
command = """
image-builder
""",
runnable_dependencies = [
":image-builder",
],
)
And trying to run foo using pants export-codegen //:foo
I get
the input device is not a TTY
If I explicitly add --interactive=false
to the docker_image then it works for the build target:
docker_image(
name = "image",
extra_run_args = [
"--interactive=false",
],
image_tags = ["dev"],
)
But then I'm unable to run a shell using pants run //:image -- /bin/bash
which can be very helpful for debugging. Is it possible to add additional docker run flags when doing pants run
? Or is it possible to not automatically add the --interactive
flag when the docker_image is being used by another build rule? Is this something I can (automatically) do myself?freezing-lamp-12123
08/26/2024, 7:18 AMlimited-art-78990
08/26/2024, 10:15 AMThe arguments for the image entrypoint may be passed on the command line after a double dash (), or using the--
option.--run-args
Defaults toInteresting, thanks!when stdout is connected to a terminal.--interactive --tty
limited-art-78990
08/26/2024, 10:16 AM:foo
in the example makes pants think that stdout is corrected to a terminal