Loading bootstrap-stage.bash +14 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ set -eu -o pipefail declare -r DEFAULT_STAGE=/stage USAGE="Usage: $0 [--help] [-s STAGE] USAGE="Usage: $0 [--help] [-s STAGE] [-l LOG] Prepare the necessary components of an image in a staging directory Loading @@ -30,18 +30,25 @@ Options: -h|--help Show this message and exit. -s|--stage STAGE Set the output stage directory. If it does not exist it will be created. (default: $DEFAULT_STAGE) -l|--log LOG Create a symlink at LOG pointing to /dev/stderr Environment: STAGE: An alternate way of providing --stage On Logging: Some software can only understand logging to a file. Use --log to make a symlink pointing to stderr to enable logging output that Docker can handle. " export PATH+=:$(dirname $0) export STAGE=${STAGE-$DEFAULT_STAGE} declare -a LOGS=() until [[ $# -eq 0 ]]; do case $1 in -h|--help) echo "$USAGE"; exit 0 ;; -s|--stage) STAGE=$2; shift ;; -l|--log) LOGS+=($2); shift ;; --*=*) set -- ${1%=*} ${1#--*=} "${@:2}"; continue ;; *) echo >&2 "Unknown argument: $1"; exit 2 ;; esac Loading @@ -64,3 +71,9 @@ test -h $STAGE/tmp || ln -s /var/tmp $STAGE/tmp # Run directories mkdir -p --mode=0755 $STAGE/var/run test -h $STAGE/run || ln -s /var/run /run # Log directories for log in "${LOGS[@]}"; do mkdir -p --mode=0755 "$(dirname "$log")" ln -s /dev/stderr "$log" done Loading
bootstrap-stage.bash +14 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ set -eu -o pipefail declare -r DEFAULT_STAGE=/stage USAGE="Usage: $0 [--help] [-s STAGE] USAGE="Usage: $0 [--help] [-s STAGE] [-l LOG] Prepare the necessary components of an image in a staging directory Loading @@ -30,18 +30,25 @@ Options: -h|--help Show this message and exit. -s|--stage STAGE Set the output stage directory. If it does not exist it will be created. (default: $DEFAULT_STAGE) -l|--log LOG Create a symlink at LOG pointing to /dev/stderr Environment: STAGE: An alternate way of providing --stage On Logging: Some software can only understand logging to a file. Use --log to make a symlink pointing to stderr to enable logging output that Docker can handle. " export PATH+=:$(dirname $0) export STAGE=${STAGE-$DEFAULT_STAGE} declare -a LOGS=() until [[ $# -eq 0 ]]; do case $1 in -h|--help) echo "$USAGE"; exit 0 ;; -s|--stage) STAGE=$2; shift ;; -l|--log) LOGS+=($2); shift ;; --*=*) set -- ${1%=*} ${1#--*=} "${@:2}"; continue ;; *) echo >&2 "Unknown argument: $1"; exit 2 ;; esac Loading @@ -64,3 +71,9 @@ test -h $STAGE/tmp || ln -s /var/tmp $STAGE/tmp # Run directories mkdir -p --mode=0755 $STAGE/var/run test -h $STAGE/run || ln -s /var/run /run # Log directories for log in "${LOGS[@]}"; do mkdir -p --mode=0755 "$(dirname "$log")" ln -s /dev/stderr "$log" done