# 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}" "$@"
I found this approach interesting:
https://raw.githubusercontent.com/linuxserver/docker-yq/master/run-yq.sh