1
0
mirror of https://github.com/php/pie.git synced 2026-03-23 23:12:17 +01:00

Remove ext-zip dependency

This commit is contained in:
James Titcumb
2025-01-02 21:17:55 +00:00
parent 4e16db76ee
commit 1898682b6c
3 changed files with 27 additions and 4 deletions

View File

@@ -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",

5
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "28cc01a87d653a0bd163e94899b6afc1",
"content-hash": "d71a5173586deb071e3d24d7c761e9c2",
"packages": [
{
"name": "composer/ca-bundle",
@@ -5945,8 +5945,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "8.1.*||8.2.*||8.3.*||8.4.*",
"ext-zip": "*"
"php": "8.1.*||8.2.*||8.3.*||8.4.*"
},
"platform-dev": {},
"platform-overrides": {

View File

@@ -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