Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ jobs:
- ghcr.io/toshy/php:8.3-fpm-trixie-otel-ffmpeg
- ghcr.io/toshy/php:8.4-fpm-trixie-otel-ffmpeg
- ghcr.io/toshy/php:8.5-fpm-trixie-otel-ffmpeg
- ghcr.io/toshy/php:8.2-fpm-trixie-otel-grpc
- ghcr.io/toshy/php:8.3-fpm-trixie-otel-grpc
- ghcr.io/toshy/php:8.4-fpm-trixie-otel-grpc
- ghcr.io/toshy/php:8.5-fpm-trixie-otel-grpc
- ghcr.io/toshy/php:8.2-fpm-trixie-otel-grpc-ffmpeg
- ghcr.io/toshy/php:8.3-fpm-trixie-otel-grpc-ffmpeg
- ghcr.io/toshy/php:8.4-fpm-trixie-otel-grpc-ffmpeg
- ghcr.io/toshy/php:8.5-fpm-trixie-otel-grpc-ffmpeg
steps:
- name: Scan for vulnerabilities
uses: crazy-max/ghaction-container-scan@a0a3900b79d158c85ccf034e5368fae620a9233a # v4.0.0
Expand Down
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,16 @@ EOT
RUN <<EOT sh
set -ex
install-php-extensions opentelemetry \
grpc \
protobuf
EOT

FROM otel AS otel-grpc

RUN <<EOT sh
set -ex
install-php-extensions grpc
EOT

FROM common AS otel-ffmpeg

# hadolint ignore=DL3008
Expand All @@ -97,6 +103,12 @@ EOT
RUN <<EOT sh
set -ex
install-php-extensions opentelemetry \
grpc \
protobuf
EOT

FROM otel-ffmpeg AS otel-grpc-ffmpeg

RUN <<EOT sh
set -ex
install-php-extensions grpc
EOT
4 changes: 3 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ variable "TARGETS" {
"base",
"ffmpeg",
"otel",
"otel-ffmpeg"
"otel-ffmpeg",
"otel-grpc",
"otel-grpc-ffmpeg"
]
}

Expand Down
67 changes: 61 additions & 6 deletions docs/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ mlocati/php-extension-installer:2.8
mysqli
pdo_mysql
exif
ftp
gd
imagick
opcache
soap
zip
Expand Down Expand Up @@ -76,11 +76,10 @@ libimage-exiftool-perl

### OTEL

Contains additional [OpenTelemetry](https://opentelemetry.io/) **PHP extensions** that are useful for observability.
Contains additional [OpenTelemetry](https://opentelemetry.io/) **PHP extensions** for observability. Uses the `http/protobuf` transport, which is fork-safe and works with PHP-FPM without any additional extensions.

```text
opentelemetry
grpc
protobuf
```

Expand All @@ -92,8 +91,7 @@ protobuf
!!! info

- [`opentelemetry`](https://opentelemetry.io/docs/what-is-opentelemetry/): High-quality, ubiquitous, and portable telemetry to enable effective observability.
- [`grpc`](https://github.com/grpc/grpc): A modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere.
- [`protobuf`](https://github.com/protocolbuffers/protobuf/tree/main/php): Significant performance improvement for otlp+protobuf exporting.
- [`protobuf`](https://github.com/protocolbuffers/protobuf/tree/main/php): Significant performance improvement for `http/protobuf` OTLP exporting.

!!! note
The `otel` image inherits the libraries from the `base` image.
Expand All @@ -106,7 +104,6 @@ Combines the `otel` PHP extensions with the `ffmpeg` media-processing libraries

```text
opentelemetry
grpc
protobuf
```

Expand All @@ -128,3 +125,61 @@ libimage-exiftool-perl
!!! note
The `otel-ffmpeg` image inherits the libraries from the `base` image and combines the additions of the `ffmpeg` and `otel` targets.

### OTEL (gRPC)

Extends the `otel` image with the `grpc` PHP extension for services that use the `grpc` OTLP transport.

```text
opentelemetry
protobuf
grpc
```

!!!tip "Container suffixed with `-otel-grpc`"
```shell
ghcr.io/toshy/php:8.5-fpm-trixie-otel-grpc
```

!!! info

- [`grpc`](https://github.com/grpc/grpc): A modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere.

!!! warning
`ext-grpc` initialises background threads at extension load time. Under PHP-FPM, which uses `fork()` to spawn workers, this can cause mutex corruption in long-running workers (SIGABRT from abseil's `mutex.cc`). This image is intended for PHP CLI / Messenger consumers that do not fork. For PHP-FPM use the `otel` image with `http/protobuf` transport instead.

!!! note
The `otel-grpc` image inherits the libraries from the `base` image and the extensions from the `otel` target.

### OTEL (gRPC) + FFmpeg

Combines the `otel-grpc` PHP extensions with the `ffmpeg` media-processing libraries.

**PHP extensions** (in addition to `common`):

```text
opentelemetry
protobuf
grpc
```

**Libraries** (in addition to `common`):

```text
zip
unzip
ffmpeg
mkvtoolnix
libimage-exiftool-perl
```

!!!tip "Container suffixed with `-otel-grpc-ffmpeg`"
```shell
ghcr.io/toshy/php:8.5-fpm-trixie-otel-grpc-ffmpeg
```

!!! warning
See the gRPC warning in the `otel-grpc` section above.

!!! note
The `otel-grpc-ffmpeg` image inherits the libraries from the `base` image and combines the additions of the `ffmpeg` and `otel-grpc` targets.