Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/static.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ FrankenPHP also supports [embedding the PHP app in the static binary](embed.md).

We provide Docker images to build static Linux binaries:

The commands below select a single Linux platform matching your machine's architecture so the builder image can be loaded into Docker's local image store.

### musl-based, fully static build

For a fully-static binary that runs on any Linux distribution without dependencies but doesn't support dynamic loading of extensions:

```console
docker buildx bake --load static-builder-musl
docker buildx bake --load --set "*.platform=linux/$(uname -m)" static-builder-musl
docker run --rm -v "$PWD/output:/output" -e OUTPUT_DIR=/output -e SPC_LOGS_DIR=/output/log dunglas/frankenphp:static-builder-musl
cp "output/frankenphp-linux-$(uname -m)" frankenphp
```
Expand All @@ -44,7 +46,7 @@ docker run --rm -v "$PWD/output:/output" -e OUTPUT_DIR=/output -e SPC_LOGS_DIR=/
For a binary that supports loading PHP extensions dynamically while still having the selected extensions compiled statically:

```console
docker buildx bake --load static-builder-gnu
docker buildx bake --load --set "*.platform=linux/$(uname -m)" static-builder-gnu
docker run --rm -v "$PWD/output:/output" -e OUTPUT_DIR=/output -e SPC_LOGS_DIR=/output/log dunglas/frankenphp:static-builder-gnu
cp "output/frankenphp-linux-$(uname -m)" frankenphp
```
Expand Down Expand Up @@ -155,7 +157,7 @@ For this, you can run the `static-builder-gnu` Docker container, remote into it,
Example steps for [the Xdebug extension](https://xdebug.org):

```console
docker buildx bake --load static-builder-gnu
docker buildx bake --load --set "*.platform=linux/$(uname -m)" static-builder-gnu
docker run --rm -v "$PWD/dist:/go/src/app/dist" -v "$PWD/output:/output" -e OUTPUT_DIR=/output -e SPC_LOGS_DIR=/output/log dunglas/frankenphp:static-builder-gnu
docker run --rm -it -v "$PWD/dist:/go/src/app/dist" dunglas/frankenphp:static-builder-gnu /bin/bash
cd /go/src/app/dist/buildroot/bin
Expand Down
Loading