Skip to content

Commit

Permalink
Only pass -it to Docker if we have a tty
Browse files Browse the repository at this point in the history
  • Loading branch information
legoktm committed Dec 15, 2023
1 parent 531d086 commit d134e19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion securedrop/bin/dev-shell
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ function docker_run() {
ci_env=""
fi

# Pass -it if we're a tty
if test -t 0; then
DOCKER_RUN_ARGUMENTS="${DOCKER_RUN_ARGUMENTS} -it"
fi

# The --shm-size argument sets up dedicated shared memory for the
# container. Our tests can fail with the default of 64m.
$DOCKER_BIN run $ci_env \
Expand All @@ -130,7 +135,7 @@ function docker_run() {
--volume "${TOPLEVEL}:${TOPLEVEL}:Z" \
--workdir "${TOPLEVEL}/securedrop" \
--name "${SD_CONTAINER}" \
-ti $DOCKER_RUN_ARGUMENTS "${1}" "${@:2}"
$DOCKER_RUN_ARGUMENTS "${1}" "${@:2}"
}

image="securedrop-slim-focal-py3"
Expand Down

0 comments on commit d134e19

Please sign in to comment.