Merge pull request #6576 from Tashows/run_attachable
Create detached container with TTY enabled for attaching remote terminal.
This commit is contained in:
@@ -4,6 +4,10 @@ set -eo pipefail
|
||||
|
||||
has_tty() {
|
||||
declare desc="return 0 if we have a tty"
|
||||
if [[ "$DOKKU_FORCE_TTY" == "true" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$DOKKU_DISABLE_TTY" == "true" ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -28,7 +28,7 @@ fn-help-content() {
|
||||
declare desc="return help content"
|
||||
cat <<help_content
|
||||
run [-e|--env KEY=VALUE] [--no-tty] <app> <cmd>, Run a command in a new container using the current app image
|
||||
run:detached [-e|-env KEY=VALUE] [--no-tty] <app> <cmd>, Run a command in a new detached container using the current app image
|
||||
run:detached [-e|-env KEY=VALUE] [--no-tty|--force-tty] <app> <cmd>, Run a command in a new detached container using the current app image
|
||||
run:list [--format json|stdout] <app>, List all run containers for an app
|
||||
run:logs <app|--container CONTAINER> [-h] [-t] [-n num] [-q], Display recent log output for run containers
|
||||
run:stop <app|--container CONTAINER>, Stops all run containers for an app or a specified run container
|
||||
|
||||
@@ -21,6 +21,10 @@ fn-run() {
|
||||
export DOKKU_DISABLE_TTY=true
|
||||
shift
|
||||
;;
|
||||
--force-tty)
|
||||
export DOKKU_FORCE_TTY=true
|
||||
shift
|
||||
;;
|
||||
--cron-id)
|
||||
if [[ ! $2 ]]; then
|
||||
dokku_log_warn "expected $1 to have an argument"
|
||||
@@ -50,6 +54,10 @@ fn-run() {
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$DOKKU_DISABLE_TTY" == "true" ]] && [[ "$DOKKU_FORCE_TTY" == "true" ]]; then
|
||||
dokku_log_fail "Cannot specify both --force-tty and --no-tty"
|
||||
fi
|
||||
|
||||
verify_app_name "$APP"
|
||||
|
||||
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||
|
||||
Reference in New Issue
Block a user