From b922d2544ed2906c7cdeeb318d91444a7d0842f3 Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Mon, 12 Oct 2026 19:38:13 +0100 Subject: [PATCH] 771: improve docs regarding usage in Docker --- README.md | 4 ++++ docs/usage.md | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 083eaad8..be57ba25 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,10 @@ curl -fL --output /tmp/pie.phar https://github.com/php/pie/releases/latest/downl && sudo chmod +x /usr/local/bin/pie ``` +> [!TIP] +> For usage in a Docker image build, we have a recommended usage example in +> [usage#example-of-pie-working-in-a-dockerfile](./docs/usage.md#example-of-pie-working-in-a-dockerfile). + ## Using PIE ### Installing a single extension using PIE diff --git a/docs/usage.md b/docs/usage.md index 1d0fa803..86fe7424 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -75,6 +75,13 @@ Docker image. Note that, like Composer, you need something like `unzip`, the [Zip](https://www.php.net/manual/en/book.zip.php) extension, or `git` to be installed. +A quick summary of what the below example does: + + - Mount PIE on `/usr/local/bin/pie` - this means PIE is only present at build time; it doesn't need to be in the runtime/final image + - Install `unzip` from apt; additional library dependencies for the extension could be added here + - Use `pie install` to install any relevant extension(s) + - Remove `unzip` and clear up `apt` lists + ```Dockerfile FROM php:8.4-cli