Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Box Laravel Package

humbug/box

View on GitHub
Deep Wiki
Context7

Docker support

Besides generating a PHAR, you may want to create a Docker image for your application. To do so, you can either:

  • Directly generate the Dockerfile when generating the PHAR with the --with-docker option of the Box compile command
  • Generate the Dockerfile for a given PHAR with the Box docker command

The command will attempt to generate a Dockerfile for your PHAR, leveraging the requirement checker. Once the file generated, you have free hands on it: you can either use it right away (you just need to run $ docker build . to create the docker image) or you can tweak it however you want.

In your Dockerfile (generated by Box), you should see the following line:

RUN $(php -r '$extensionInstalled = array_map("strtolower", \get_loaded_extensions(false));$requiredExtensions = ["zlib", "phar", "openssl", "pcre", "tokenizer"];$extensionsToInstall = array_diff($requiredExtensions, $extensionInstalled);if ([] !== $extensionsToInstall) {echo \sprintf("docker-php-ext-install %s", implode(" ", $extensionsToInstall));}echo "echo \"No extensions\"";')

This cryptic one-liner PHP script is about installing the required extensions for your application: it compares the ones your application requires with the ones already provided by the base PHP image, and then install them using the docker-php-ext-install command. It is however possible that this fails for various reason: the extension is not a known one, it cannot be installed the traditional way, it needs to be compiled with PHP... For all those cases (unless you have a better way to handle it in which case PRs are welcomed) you will have to dirty your hands and tweak the Dockerfile to your needs.

ยซ PHAR code isolation โ€ข Symfony support ยป

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table