summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-07-30 14:09:06 -0700
committergVisor bot <gvisor-bot@google.com>2020-07-30 14:11:09 -0700
commit877fac48643772d3549b32d50b6d5f560770beb3 (patch)
tree9cd3c0a273a6a4a95d9b38e25a9adbff84b4b4ba
parent78f1a18ab31fdc15155dd83d3ca96129b5031711 (diff)
Allocate a pseudo-tty for exec.
Otherwise Ctrl-C will kill the 'docker exec' as opposed to killing the bazel command being run inside the container. PiperOrigin-RevId: 324079339
-rw-r--r--tools/bazel.mk5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/bazel.mk b/tools/bazel.mk
index 88faa0190..82fe11a03 100644
--- a/tools/bazel.mk
+++ b/tools/bazel.mk
@@ -48,7 +48,10 @@ FULL_DOCKER_RUN_OPTIONS += -v "$(BAZEL_CACHE):$(BAZEL_CACHE)"
FULL_DOCKER_RUN_OPTIONS += -v "$(GCLOUD_CONFIG):$(GCLOUD_CONFIG)"
FULL_DOCKER_RUN_OPTIONS += -v "/tmp:/tmp"
FULL_DOCKER_EXEC_OPTIONS := --user $(UID):$(GID)
-FULL_DOCKER_EXEC_OPTIONS += -i
+FULL_DOCKER_EXEC_OPTIONS += --interactive
+ifeq (true,$(shell [[ -t 0 ]] && echo true))
+FULL_DOCKER_EXEC_OPTIONS += --tty
+endif
# Add docker passthrough options.
ifneq ($(DOCKER_PRIVILEGED),)