From f8eb99f86390e63517f7d70d0585225ec1ec0ec8 Mon Sep 17 00:00:00 2001 From: Derek Bourgeois Date: Sun, 5 Apr 2026 02:24:42 -0400 Subject: [PATCH 1/2] fix: add octane swoole build dependencies --- stubs/docker/octane.Dockerfile.stub | 2 ++ tests/Unit/Docker/DockerfileGeneratorTest.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/stubs/docker/octane.Dockerfile.stub b/stubs/docker/octane.Dockerfile.stub index 4d01316..47fe518 100644 --- a/stubs/docker/octane.Dockerfile.stub +++ b/stubs/docker/octane.Dockerfile.stub @@ -15,12 +15,14 @@ FROM php:${PHP_VERSION}-cli-alpine AS beacon WORKDIR /var/www/html RUN apk add --no-cache \ + brotli-dev \ git \ icu-data-full \ icu-libs \ libstdc++ \ linux-headers \ oniguruma-dev \ + openssl-dev \ $PHPIZE_DEPS \ && pecl install swoole \ && docker-php-ext-enable swoole \ diff --git a/tests/Unit/Docker/DockerfileGeneratorTest.php b/tests/Unit/Docker/DockerfileGeneratorTest.php index d32f4eb..f33d6a5 100644 --- a/tests/Unit/Docker/DockerfileGeneratorTest.php +++ b/tests/Unit/Docker/DockerfileGeneratorTest.php @@ -37,7 +37,11 @@ $contents = $generator->render($configuration); - expect($contents)->toContain('pecl install swoole') + expect($contents)->toContain('brotli-dev') + ->and($contents)->toContain('openssl-dev') + ->and($contents)->toContain('pecl install swoole') + ->and($contents)->toContain("brotli-dev \\\n git") + ->and($contents)->toContain("oniguruma-dev \\\n openssl-dev") ->and($contents)->toContain('LABEL io.devoption.beacon.runtime="octane"') ->and($contents)->toContain('EXPOSE 8000') ->and($contents)->toContain('CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8000"]'); From e09ca10885446269df591a2fc4feae149b6ca5be Mon Sep 17 00:00:00 2001 From: Derek Bourgeois Date: Sun, 5 Apr 2026 12:24:05 -0400 Subject: [PATCH 2/2] test: relax octane dockerfile package assertions --- tests/Unit/Docker/DockerfileGeneratorTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/Unit/Docker/DockerfileGeneratorTest.php b/tests/Unit/Docker/DockerfileGeneratorTest.php index f33d6a5..9cb77ce 100644 --- a/tests/Unit/Docker/DockerfileGeneratorTest.php +++ b/tests/Unit/Docker/DockerfileGeneratorTest.php @@ -36,12 +36,15 @@ ); $contents = $generator->render($configuration); + $matched = preg_match('/RUN apk add --no-cache\s+(.+?)\s+&& pecl install swoole/s', $contents, $matches); - expect($contents)->toContain('brotli-dev') - ->and($contents)->toContain('openssl-dev') + expect($matched)->toBe(1); + + $apkAddBlock = $matches[1]; + + expect($apkAddBlock)->toContain('brotli-dev') + ->and($apkAddBlock)->toContain('openssl-dev') ->and($contents)->toContain('pecl install swoole') - ->and($contents)->toContain("brotli-dev \\\n git") - ->and($contents)->toContain("oniguruma-dev \\\n openssl-dev") ->and($contents)->toContain('LABEL io.devoption.beacon.runtime="octane"') ->and($contents)->toContain('EXPOSE 8000') ->and($contents)->toContain('CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8000"]');