Skip to content
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

Use haulable to port phar into standalone executables for multiple oses! #38

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

KTanAug21
Copy link
Contributor

@KTanAug21 KTanAug21 commented May 2, 2024

WHAT AND WHY:

  • Use haulable( which uses PHP MICRO ) to create standalone binaries of the package for different os'es.
  • Call a Laravel Fly App to upload created binaries to a public Tigris bucket
  • The flyctl scanner uses this package to generate dockerfiles now! But some users' environments are not able to install the package due to different reasons. PHP version. Composer not installed. Creating an executable can allow the scanner to download a suitable os executable directly and run that instead.

HOW:

  • Create a github workflow called build.yml. It contains command to build the phar of the package THEN run haulable( such a blessing! ) to create executables for different platforms.
  • Upload each executable as a run artifact
  • Call a Laravel Fly App to download and upload each artifact to a Tigris bucket "dockerfile-laravel-buckets-public"

@Johannes-Werbrouck
Copy link

I find it remarkable that users that are developing Laravel applications have issues with php or composer, but if we can solve this problem for them why wouldn't we! Well done!

@Johannes-Werbrouck
Copy link

I do wonder though, does this slow down the dockerfile generation?

@KTanAug21
Copy link
Contributor Author

KTanAug21 commented May 5, 2024

I do wonder though, does this slow down the dockerfile generation?

Hi @Johannes-Werbrouck ! The dockerfile generation is indeed faster when using the phar file found in vendor/bin/dockerfile-laravel of a laravel project when the package is installed via composer.

Compared to the generation time it takes when the standalone itself is run.

BUT! It is better than not getting to run the dockerfile-laravel generator at all. right.

Downloading the standalone build and running it would be the last fallback in case there's any issue with installing the package (or running it).

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

Successfully merging this pull request may close these issues.

Create a Self-contained Self-executable binary out of the binary built
2 participants