Weave Code
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky