bin/php
#!/usr/bin/env sh
set -e
command -v docker >/dev/null 2>&1 || { echo "docker is required to run this binary. Aborting." >&2; exit 1; }
USER=${USER:-$( id -un )}
GROUP=${GROUP:-$( id -gn )}
COMPOSER_HOME=${COMPOSER_HOME:-${HOME}/.composer}
PHP_VERSION=${PHP_VERSION:-7.4}
DOCKER_OPTS=${DOCKER_OPTS:-'-it'}
exec docker run ${DOCKER_OPTS} --rm \
-u $( id -u ${USER} ):$( id -g ${USER} ) \
-v "${PWD}":"${PWD}" \
-v "${COMPOSER_HOME}":/tmp/composer \
-w ${PWD} \
-e PHP_IDE_CONFIG="serverName=schema-registry-client" \
-e PHP_CS_FIXER_IGNORE_ENV=1 \
-e COMPOSER_HOME="/tmp/composer" \
--net=host --sig-proxy=true --pid=host \
--entrypoint="php" \
schema-registry-client:${PHP_VERSION} "${@}"