phpunit() {jq--version1>/dev/null2>&1if [ 0-ne"$?" ]; thenecho"jq required"echo"You can get it from https://stedolan.github.io/jq/"exitfi PHP_CONTAINER_NAME=$(dockerps--filter"label=com.docker.compose.service=php"--format"{{.Names}}") CWD=$PWD MOUNTS=$(dockerinspect-f"{{json .Mounts}}""$PHP_CONTAINER_NAME")for MOUNT in $(echo $MOUNTS |jq-c'.[]'); do SOURCE=$(echo $MOUNT |jq-r'.Source') SOURCE=${SOURCE//\//\\\/} DESTINATION=$(echo $MOUNT |jq-r'.Destination') CWD=${CWD/#$SOURCE/$DESTINATION}donedockerexec-i-w"$CWD""$PHP_CONTAINER_NAME"phpunit"$@"}export-f phpunit