You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone,
I wondered what the reasoning behind the argument check in the docker-entrypoint script for the apache and fpm images is:
...
if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then
...
As far as I can tell, all images use either apache2-foreground or php-fpm as command, so the check seems redundant.
I stumbled upon this as I was trying to run a script between the entry point and the command. When using this solution, the image's own entry point script of course skips the if-clause. After digging a bit more, I found an issue where people get around this by renaming their scripts.
So to me it seems the check should be either removed or replaced with a search for apache2 or php-fpm within all arguments, so people can more easily add custom scripts.
That is, of course, if there is no special reasoning behind this check.
The text was updated successfully, but these errors were encountered:
The reasoning is that we don't want to cause unexpected behavior for users who are running other things in the image (https://github.com/docker-library/official-images#consistency) -- if a user runs bash, they should expect that it runs bash and other behavior is typically unexpected.
What we suggest in cases like you describe is having the script run before the image's entrypoint instead of after (ie, my-script.sh docker-entrypoint.sh apache2-foreground instead of docker-entrypoint.sh my-script.sh apache2-foreground).
I understand the idea, but then what's the point of a WordPress image that doesn't contain WordPress when I start it? I can see use cases where I want to start a bash as soon as the container is ready, but they all require a working WordPress instance, which is why I use the image in the first place.
run before the image's entrypoint instead
That's explicitly not what the people aim to do in the issues I link. They want firstly a working WordPress instance and then run their own script. In my case, I want to install plugins via wp-cli, which I can't do before WordPress is installed.
Hello everyone,
I wondered what the reasoning behind the argument check in the docker-entrypoint script for the apache and fpm images is:
As far as I can tell, all images use either
apache2-foreground
orphp-fpm
as command, so the check seems redundant.I stumbled upon this as I was trying to run a script between the entry point and the command. When using this solution, the image's own entry point script of course skips the if-clause. After digging a bit more, I found an issue where people get around this by renaming their scripts.
So to me it seems the check should be either removed or replaced with a search for
apache2
orphp-fpm
within all arguments, so people can more easily add custom scripts.That is, of course, if there is no special reasoning behind this check.
The text was updated successfully, but these errors were encountered: