Skip to content

Commit

Permalink
[Docker] Re-enabled automatic --tty flag when running bash. (apache#8861
Browse files Browse the repository at this point in the history
)

PR8382 split apart the --interactive and --tty flags, but only
--interactive was set if the user opens a bash session.  This commit
restores the previous behavior of running `docker/bash.sh IMAGE_NAME`
of opening a bash session with both --interactive and --tty.
  • Loading branch information
Lunderberg authored and ylc committed Sep 29, 2021
1 parent b57c7ed commit af0b36d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docker/bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ set -euo pipefail

function show_usage() {
cat <<EOF
Usage: docker/bash.sh [-i|--interactive] [--net=host]
Usage: docker/bash.sh [-i|--interactive] [--net=host] [-t|--tty]
[--mount MOUNT_DIR] [--repo-mount-point REPO_MOUNT_POINT]
[--dry-run]
<DOCKER_IMAGE_NAME> [--] [COMMAND]
Expand Down Expand Up @@ -95,7 +95,7 @@ DOCKER_IMAGE_NAME
COMMAND
The command to be run inside the docker container. If this is set
to "bash", both the --interactive and --net=host flags are set.
to "bash", the --interactive, --tty and --net=host flags are set.
If no command is specified, defaults to "bash". If the command
contains dash-prefixed arguments, the command should be preceded
by -- to indicate arguments that are not intended for bash.sh.
Expand Down Expand Up @@ -235,6 +235,7 @@ fi

if [[ ${COMMAND[@]+"${COMMAND[@]}"} = bash ]]; then
INTERACTIVE=true
TTY=true
USE_NET_HOST=true
fi

Expand Down

0 comments on commit af0b36d

Please sign in to comment.