Skip to content

Commit 261e605

Browse files
Tinywanclaude
andcommitted
feat: 添加 PHP 7.4.33-cli-alpine 版本支持
- 更新基础镜像为 php:7.4.33-cli-alpine - 添加 swoole-4.8.12.tgz 用于 PHP 7.x - 优化 install.sh 中 swoole 扩展的版本判断逻辑,支持不同 PHP 版本使用对应的 swoole 版本 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 92e0e1a commit 261e605

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM php:8.3.30-cli-alpine
1+
FROM php:7.4.33-cli-alpine
22

33
LABEL Maintainer="ShaoBo Wan (Tinywan) <756684177@qq.com>" \
4-
Description="Webman Lightweight container with PHP 8.4.16 based on Alpine Linux."
4+
Description="Webman Lightweight container with PHP 7.4.33 based on Alpine Linux."
55

66
# Use Alibaba Cloud mirror for faster downloads
77
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories

extension/install.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,22 @@ if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
553553
docker-php-ext-enable swoole
554554
rm -rf swoole
555555
else
556-
mkdir swoole
557-
tar -xf swoole-6.1.6.tgz -C swoole --strip-components=1
558-
(cd swoole && phpize && ./configure --enable-sockets --enable-openssl && make ${MC} && make install)
559-
docker-php-ext-enable swoole
560-
rm -rf swoole
556+
isPhpVersionGreaterOrEqual 8 0
557+
if [[ "$?" = "1" ]]; then
558+
# PHP 8.0-8.3 requires swoole 5.x
559+
mkdir swoole
560+
tar -xf swoole-5.1.4.tgz -C swoole --strip-components=1
561+
(cd swoole && phpize && ./configure --enable-sockets --enable-openssl && make ${MC} && make install)
562+
docker-php-ext-enable swoole
563+
rm -rf swoole
564+
else
565+
# PHP 7.x requires swoole 4.x
566+
mkdir swoole
567+
tar -xf swoole-4.8.12.tgz -C swoole --strip-components=1
568+
(cd swoole && phpize && ./configure --enable-sockets --enable-openssl && make ${MC} && make install)
569+
docker-php-ext-enable swoole
570+
rm -rf swoole
571+
fi
561572
fi
562573
fi
563574

extension/swoole-4.8.12.tgz

1.67 MB
Binary file not shown.

0 commit comments

Comments
 (0)