-
-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC: Enable extensions + staged build #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for working on that.
This is the docker image which is currently working for me using:
https://github.com/alexander-schranz/frankenphp/blob/feature/php-extensions/Dockerfile |
Super smart trick! |
@alexander-schranz |
@stefanpoensgen in the |
It is active indeed. But if I look at "Symfony initialization" and "Peak memory usage" in the profiler, it is 4 times higher than with my usual caddy+phpfpm setup. These are pretty much the values I get when I disable opcache :D |
Maybe @dunglas has a hint here. I could not do a performance test yet. As I only uses none Docker PHP runner in other cases, because Docker is really slow on my machine (mac optimization can not be enabled docker freezes then). |
Updated the Dockerfile, now builds extensions just fine. I've included the
Then verify the extension is present when going to https://localhost |
Opcache needs to be installed/enabled separately with this change. We can enable it again, though sometimes opcache is not desired (for example, when building an image with xdebug enabled). |
I've added a |
@stefanpoensgen you are correct the opcache is not working as it seems sadly not use the correct |
@alexander-schranz, this comment doesn't seem to be related to this PR, but if you're talking about this comment then it is because that env var is only used during the initial build and is never used again. Further, this wouldn't work because none of the scripts expect a |
Thank you @withinboredom! Great work |
🎉 @withinboredom great work 👍 |
The first stage builds PHP, taking into account some "best practices" from the official image and is built on the official image. It is a stand-in for the official image that is yet to exist (PHP 8.3).
The second stage uses the first stage and copies in the golang build environment from the official golang image. It then builds frankenphp.
The final stage combines the output from the first and second stages from the official PHP image. Once PHP 8.3 is released, this step will just be copying the output from the second stage instead of combining first & second stage.