Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion docs/ja/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie

#### Dockerfile での PIE の動作例

これは Docker イメージ内で PIE を使用して拡張機能をインストールする方法の例です。Composer と同様に、`unzip`、[Zip](https://www.php.net/manual/ja/book.zip.php) 拡張機能、または `git` のようなものが必要です。
これは Docker イメージ内で PIE を使用して拡張機能をインストールする方法の例です。Composer と同様に、ダウンロードしたパッケージを展開するために `unzip` または [Zip](https://www.php.net/manual/ja/book.zip.php) 拡張機能が必要です。

> [!NOTE]
> 以前は `git` がインストールされていれば代替となりました。展開に失敗した場合、Composer がソースからのチェックアウトにフォールバックしていたためです。Composer 2.10 はセキュリティ上の理由でこのフォールバックを削除し([composer/composer#12885](https://github.com/composer/composer/pull/12885))、PIE は 1.4.8 以降 Composer 2.10 を使用するため、`git` だけでは不十分です。`pie repository:add vcs ...` で追加したリポジトリなど、Composer が git 経由で読み取るリポジトリには引き続き必要です。

```Dockerfile
FROM php:8.4-cli
Expand Down
15 changes: 12 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,18 @@ Instead of `bin` tag (which represents latest binary-only image) you can also us
#### 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.
Docker image. Note that, like Composer, you need `unzip` or the
[Zip](https://www.php.net/manual/en/book.zip.php) extension to be installed, so
that the downloaded package can be extracted.

> [!NOTE]
> Having `git` installed used to be an alternative, because Composer fell back
> to a source checkout when extraction failed. Composer 2.10 removed that
> fallback for security reasons
> ([composer/composer#12885](https://github.com/composer/composer/pull/12885)),
> and PIE uses Composer 2.10 as of 1.4.8, so `git` on its own is no longer
> enough. It is still needed for repositories that Composer reads over git,
> such as those added with `pie repository:add vcs ...`.

```Dockerfile
FROM php:8.4-cli
Expand Down
5 changes: 4 additions & 1 deletion docs/zh/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie

#### 在 Dockerfile 中使用 PIE 的示例

这是如何在 Docker 镜像中使用 PIE 安装扩展的示例。注意,与 Composer 类似,您需要安装 `unzip`、[Zip](https://www.php.net/manual/zh/book.zip.php) 扩展或 `git`。
这是如何在 Docker 镜像中使用 PIE 安装扩展的示例。注意,与 Composer 类似,您需要安装 `unzip` 或 [Zip](https://www.php.net/manual/zh/book.zip.php) 扩展,以便解压下载的软件包。

> [!NOTE]
> 以前只安装 `git` 也可以,因为解压失败时 Composer 会回退到从源代码检出。Composer 2.10 出于安全原因移除了该回退([composer/composer#12885](https://github.com/composer/composer/pull/12885)),而 PIE 从 1.4.8 起使用 Composer 2.10,因此仅安装 `git` 已不再足够。对于 Composer 需要通过 git 读取的仓库(例如通过 `pie repository:add vcs ...` 添加的仓库),仍然需要 `git`。

```Dockerfile
FROM php:8.4-cli
Expand Down