-
|
So far we used PECL and are now trying to replace it with Pie, but having some issues with automating it. Just as a short background, due to our container structure we're at first building a base image and afterwards using that as a base to build more granular images for different purposes (e.g. app and cron). But they share the same PHP setup and to avoid redundant work and time, PHP is already installed in the base image. For now that was quite simple and we could simply use Having the setup given, we tried to use Pie in a similar way and hit an issue with this non interactive approach. (Installing multiple extensions at once is not yet possible, but there's already a feature request for it: #466) But we're more in favor of relying on the composer.json integration to avoid defining the extensions twice, cause for Composer they are anyways already defined. So just calling: And here's our issue, the resolution of So, the final question, is there any way to use Pie in a fully non interactive way, using the composer.json as a source? The only working but unsafe way to achieve it, by automatically accepting option 1 of the prompts, seems to be currently |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
First a question for you: For FROM ubuntu AS test_non_interactive
RUN apt-get update && apt-get install -y php unzip libbz2-dev gcc make autoconf bison re2c pkg-config libtool php-dev
COPY --from=build_pie_phar /app/pie.phar /usr/local/bin/pie
RUN mkdir /foo
WORKDIR /foo
RUN echo '{"require":{"php":"~8.3.0","ext-mongodb":"~2.1","ext-redis":"~6.1"}}' >> /foo/composer.json
RUN echo '{"_readme":["This file locks the dependencies of your project to a known state","Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies","This file is @generated automatically"],"content-hash":"201d95d4413cb1f999fba94555181bb0","packages":[],"packages-dev":[],"aliases":[],"minimum-stability":"stable","stability-flags":{},"prefer-stable":false,"prefer-lowest":false,"platform":{"php":"~8.3.0","ext-mongodb":"~2.1","ext-redis":"~6.1"},"platform-dev":{},"plugin-api-version":"2.6.0"}' >> /foo/composer.lock
RUN pie install --allow-non-interactive-project-install
RUN pie showAnd this successfully installs the two missing extensions: In this particular instance, it However, yes; if there is more than one extension (maybe there is an extension not given in your example) that provides the This is definitely something I'd like to improve on, but we need to find an effective way for PIE users to say "when I want |
Beta Was this translation helpful? Give feedback.
First a question for you:
For
ext-mongodbandext-redis, there should only be one option for either of those; so those two specific extensions shouldn't prompt when using--allow-non-interactive-project-install- could you check which specific extensions are being asked for in that case? To try to reproduce your issue, I built a Dockerfile with the following: