Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Docker: Composer doesn't use supplied php.ini #15

Closed
cedricziel opened this issue Dec 10, 2015 · 1 comment
Closed

Docker: Composer doesn't use supplied php.ini #15

cedricziel opened this issue Dec 10, 2015 · 1 comment

Comments

@cedricziel
Copy link
Contributor

The supplied composer runner doesnt respect the supplied php.ini which makes it really hard to run post-install scripts that utilize for example symfony/console to generate optimized autoloaders (example: Laravel 5.1)

[Symfony\Component\Process\Exception\RuntimeException]
The Process class relies on proc_open, which is not available on your PHP installation.

I see that you've disabled the function on purpose, but really they shouldnt be limited on the CLI for one-off commands.

From my point of view, there's multiple possible solutions to the problem:

  1. use the supplied php.ini to allow save overrides
  2. use another php.ini (for example php.cli.ini) just for composer
  3. use another ini setting on the cli
  4. override the contained php.ini in the image

I know I can override the supplied php.ini - maybe just document it to make it easier for people who are not into docker very much?

@cedricziel
Copy link
Contributor Author

Okay - overriding the composer.sh script does not work due to the fact that the onbuild hook is executed before (at least that's what I think)

The following does not work:

FROM gcr.io/php-mvm-a/php-nginx:latest
COPY .docker/php.ini $PHP56_DIR/lib/php.ini
COPY .docker/php.ini $PHP7_DIR/lib/php.ini
ENV DOCUMENT_ROOT /app/public
# A script for installing dependencies.
COPY .docker/composer.sh /composer.sh
RUN chmod +x /composer.sh
ONBUILD RUN /composer.sh

I think the only way to fix this, is to adjust the configuration directives right on the command on to not leave it to the user of this image.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant