Uh oh!
There was an error while loading. Please reload this page.
Alpine image - #43
Conversation
dunglas
commented
Oct 19, 2022
Thanks for your very appreciated contribution! Do you think that it would be possible to use a template file to build both variants, as done in the official Docker PHP repo? https://github.com/docker-library/php/blob/master/Dockerfile-linux.template |
back-2-95
commented
Oct 20, 2022
I was thinking to utilize stages and build targets in bake file further as it's easier to read. Here is example where I create different kind of PHP variants from same Dockerfile: https://github.com/druidfi/docker-images/tree/main/php It creates 3 PHP minor versions, base php, fpm, drupal, drupal+nginx, all for amd64/arm64. But I think it could be something for other PR. Sometimes avoiding DRY goes too far 😅 I'd appreciate if Also I was thinking it the ARGs I added here could be used in original Dockerfile too? These: |
dunglas
commented
Oct 20, 2022
I would prefer to be as close as possible from the images and the tooling from the official images to reduce the maintenance burden. The long term goal is to get rid at least of the PHP build stage anyway and use official images instead. |
back-2-95
commented
Oct 20, 2022
That is true. I guess the the most heavy stage will be removed when php-src will include those few changes? |
dunglas
commented
Oct 20, 2022
Indeed |
back-2-95
commented
Oct 20, 2022
I checked the "template-engine" from that official PHP source. It would quite an effort to learn that and incorporate here (even if that is just shell script based thing). And if we get to situation where we can remove the php-src build stage all together, it would become obsolete. It seems also that they have 4 distro variants: 2 alpines, Buster and Bullseye. When we could rely on official PHP base images here as they are, this will come super simple and readable setup where we can create easily images for different PHP versions like 8.2, 8.3 and those officially supported distros + architectures. |
back-2-95
commented
Oct 21, 2022
Pulled the latest changes and updated PR accordingly. |
back-2-95
commented
Oct 21, 2022
@dunglas do you expect that those Frankenphp commits from https://github.com/php/php-src.git and branch |
Shouldn't we also update the GitHub Actions setup? Could you also remove the args, please? It will make the image consistent with the Debian variant and limit the possible unintended side effects. We'll remove this stage anyway as soon as a new 8.2 version is tagged and docker-library/php#1331 is merged. |
back-2-95
commented
Oct 21, 2022
@dunglas done 👍 |
back-2-95
commented
Oct 21, 2022
@dunglas and the GHA setup updated too |
back-2-95
commented
Oct 21, 2022
Tested both images with Demo app (Symfony) and benchmarks locally with my M1 Macbook Pro (arm64 images). Demo works the same with both images. |
dunglas
commented
Oct 21, 2022
Thank you very much @back-2-95! |
See the
docs/docker.mdfor how to test.Needs some validation that
Dockerfile.alpinehas all the stuff correctly as package names and some operations are different in Alpine.Note: Some command chains are broken down to separate
RUNlines as in build stages there is no point and separate lines make it faster to debug and use working layers.Resolves#42