Skip to content

Commit 65cef26

Browse files
authored
Merge pull request #980 from jingjingxyk/build_native_php
Build native php
2 parents 818a14e + 454472c commit 65cef26

20 files changed

+322
-210
lines changed

.github/workflows/auto-cache-pool-tarball.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ jobs:
7373
mkdir -p pool/ext
7474
mkdir -p pool/php-tar/
7575
mkdir -p runtime/
76-
if [ ! -f runtime/php ] ; then
76+
if [ ! -f runtime/php/php ] ; then
7777
bash setup-php-runtime.sh
7878
fi
7979
8080
WORK_DIR=${{ github.workspace }}
81-
export PATH=${WORK_DIR}/runtime/:$PATH
82-
alias php="php -d curl.cainfo=${WORK_DIR}/runtime/cacert.pem -d openssl.cafile=${WORK_DIR}/runtime/cacert.pem"
81+
export PATH=${WORK_DIR}/runtime/php/:$PATH
82+
alias php="php -d curl.cainfo=${WORK_DIR}/runtime/php/cacert.pem -d openssl.cafile=${WORK_DIR}/runtime/php/cacert.pem"
8383
8484
composer install --no-interaction --no-autoloader --no-scripts --profile --no-dev
8585
composer dump-autoload --optimize --profile --no-dev

.github/workflows/build-alpine-builder-container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ case $ARCH in
5050
PLATFORM="linux/mips64le"
5151
;;
5252
'loongarch64')
53-
PLATFORM="linux/mips64le"
53+
PLATFORM="linux/loongarch64"
5454
;;
5555
esac
5656

.github/workflows/build-debian-builder-container.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -exu
44
__DIR__=$(
@@ -18,7 +18,9 @@ cp -f ${__PROJECT__}/sapi/quickstart/linux/debian-init.sh .
1818
cp -f ${__PROJECT__}/sapi/quickstart/linux/extra/debian-php-init.sh .
1919

2020
cat > Dockerfile <<'EOF'
21-
FROM debian:unstable-20240110-slim
21+
ARG BASE_IMAGE=debian:12
22+
FROM ${BASE_IMAGE}
23+
# FROM debian:unstable
2224
2325
ENV DEBIAN_FRONTEND=noninteractive
2426
ENV TZ=Etc/UTC
@@ -43,12 +45,15 @@ EOF
4345

4446

4547
PLATFORM='linux/amd64'
46-
48+
BASE_IMAGE="debian:12"
4749
while [ $# -gt 0 ]; do
4850
case "$1" in
4951
--platform)
5052
PLATFORM="$2"
5153
;;
54+
--container-image)
55+
BASE_IMAGE="$2"
56+
;;
5257
--*)
5358
echo "Illegal option $1"
5459
;;
@@ -59,8 +64,8 @@ done
5964

6065

6166
IMAGE='swoole-cli-builder:latest'
62-
docker buildx build -t ${IMAGE} -f ./Dockerfile . --platform ${PLATFORM}
63-
67+
docker buildx build -t ${IMAGE} -f ./Dockerfile . --platform ${PLATFORM} --build-arg BASE_IMAGE="${BASE_IMAGE}"
68+
docker images
6469
docker save -o "swoole-cli-builder-image.tar" ${IMAGE}
6570

6671

.github/workflows/linux-aarch64-qemu.yml

Lines changed: 0 additions & 114 deletions
This file was deleted.

.github/workflows/linux-aarch64.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
mkdir -p pool/ext
106106
mkdir -p bin/
107107
mkdir -p runtime/
108-
if [ ! -f runtime/php ] ; then
108+
if [ ! -f runtime/php/php ] ; then
109109
bash setup-php-runtime.sh
110110
fi
111111
bash sapi/download-box/download-box-get-archive-from-server.sh
@@ -120,8 +120,8 @@ jobs:
120120
run: |
121121
set -eux
122122
uname -m
123-
export PATH=/work/runtime:$PATH # 容器已经内置 php 和 composer
124-
alias php="php -d curl.cainfo=/work/runtime/cacert.pem -d openssl.cafile=/work/runtime/cacert.pem"
123+
export PATH=/work/runtime/php/:$PATH # 容器已经内置 php 和 composer
124+
alias php="php -d curl.cainfo=/work/runtime/php/cacert.pem -d openssl.cafile=/work/runtime/php/cacert.pem"
125125
126126
# sed -i 's/mirrors.tuna.tsinghua.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositories
127127
# sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositories

0 commit comments

Comments
 (0)