databio / bulker

Manager for multi-container computing environments
https://bulker.io
BSD 2-Clause "Simplified" License
24 stars 2 forks source link

Auto-detect -t? #73

Closed nsheff closed 3 years ago

nsheff commented 3 years ago

I found this approach interesting:

https://raw.githubusercontent.com/linuxserver/docker-yq/master/run-yq.sh


# Only allocate tty if we detect one
if [ -t 0 ] && [ -t 1 ]; then
    DOCKER_RUN_OPTIONS="${DOCKER_RUN_OPTIONS} -t"
fi

# Always set -i to support piped and terminal input in run/exec
DOCKER_RUN_OPTIONS="${DOCKER_RUN_OPTIONS} -i"

# shellcheck disable=SC2086
exec docker run --rm ${DOCKER_RUN_OPTIONS} ${YQ_OPTIONS} ${VOLUMES} -w "${PWD}" --entrypoint yq "${YQ_IMAGE_TAG:-ghcr.io/linuxserver/yq:latest}" "$@"
nsheff commented 3 years ago

duplicate of #72