alterway / docker-php

Docker PHP
MIT License
99 stars 45 forks source link

PHP fails to run if positional parameters contain spaces #14

Open mrcasual opened 3 years ago

mrcasual commented 3 years ago

Use case: docker run --rm alterway/php:7.4-cli "/path with spaces/to/phpunit.phar"

The command will fail due to word splitting that happens in entrypoint.sh when parameters are expanded:

[...]

if [[ ! -z "$1" ]]; then
    exec php ${*}
else
    exec php -h
fi

Changing php ${*} to php "${@}" fixes the issue.