Skip to content

docker-entrypoint.sh conditional check prevents extension of CMD #691

Closed
@mattjbrent

Description

@mattjbrent

We recently encountered an issue with this image where we wanted to run supervisord to run CRON and sshd on the same image.

High level description
The entire entrypoint script is dependent on apache2* and php-fpm* commands being called in the CMD directive in the Dockerfile. Given the nature of docker and it's default of extensibility, any command passed to CMD effectively causes the entrypoint to not execute, breaking the image as WordPress install files do not get copied over.

Possible fixes or suggestions
There are a couple of approaches

  1. Not change the entrypoint. But improve the documentation so this unusual behavior is clearer
  2. Modify the entrypoint so that it creates some kind of default if the first command in CMD doesn't start with apache2* or php-fpm* (for eg default to apache2
  3. Alternatively, you could split out the generic logic in the entrypoint script into another script. and have this new script called by separate entrypoints for both php-fpm and apache images. This would do away the need for that variable check at the top and also provide more flexibility in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions