bazel-watcher: ibazel run on container_image does not work

I have a container_image like follows:

container_image(
    name = "image",
    base = "@nginx_alpine//image",
    directory = "/etc/nginx/",
    docker_run_flags = "--rm -it -p 8080:8080",
    files = [
        "nginx.conf",
    ],
    legacy_run_behavior = False,
)

and all works well when doing bazel run :image, it starts the image, i can CTRL+C out of it etc. but when using ibazel run I am getting the error message from docker:

the input device is not a TTY

By removing either the -i or -t in the docker_run_flags I can get around the error message but then pressing CTRL+C does not actually stop the docker container and on rebuild then it complains that the port is already allocated.

Not sure if there is an easy way to fix this and also happy to investigate myself (though will not happen in the next weeks) but wanted to make sure it is tracked.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 15 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@vanils thanks for figuring this out! I’d be very happy to help with testing a PR.

I’m happy to try and narrow down the issue, I think the first step would be for me to make a little standalone repo that illustrates the problem, and then it will take some investigating to try and narrow down why the process is not getting killed.

Sounds like a great opportunity for a first PR. How can I help you with that?