Skip to content

Commit

Permalink
Remove ext-zip dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
asgrim committed Jan 2, 2025
1 parent 883447d commit da949f3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
],
"require": {
"php": "8.1.*||8.2.*||8.3.*||8.4.*",
"ext-zip": "*",
"composer/composer": "^2.8.4",
"composer/pcre": "^3.3.2",
"composer/semver": "^3.4.3",
Expand Down
5 changes: 2 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,31 @@ Instead of `bin` tag (which represents latest binary-only image) you can also us
> [!IMPORTANT]
> Binary-only images don't include PHP runtime so you can't use them for _running_ PIE. This is just an alternative way of distributing PHAR file, you still need to satisfy PIE's runtime requirements on your own.
#### Example of PIE working in a Dockerfile

This is an example of how PIE could be used to install an extension inside a
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.

```Dockerfile
FROM php:8.4-cli

# Add the `unzip` package which PIE uses to extract .zip files
RUN apt-get -y update \
&& apt-get install -y --no-install-recommends unzip \
&& rm -rf /var/lib/apt/lists/*

# Copy the pie.phar from the latest `:bin` release
COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie

# Use PIE to install an extension...
RUN pie install asgrim/example-pie-extension
```

If the extension you would like to install needs additional libraries or other
dependencies, then these must be installed beforehand too.

## Prerequisites for PIE

Running PIE requires PHP 8.1 or newer. However, you may still use PIE to install
Expand Down

0 comments on commit da949f3

Please sign in to comment.