Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment feature #690

Merged
merged 6 commits into from
Jul 11, 2024
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
2 changes: 1 addition & 1 deletion diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
->remove('core');

ob_start();
require_once __DIR__ . '/sapi/DownloadPHPSourceCode.php';
require_once __DIR__ . '/sapi/scripts/DownloadPHPSourceCode.php';
$php_source_folder = PHP_SRC_DIR;
ob_end_clean();

Expand Down
14 changes: 10 additions & 4 deletions sapi/docker/build-export-container.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

:<<'COMMENT'
从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器镜像 和 导出镜像到磁盘

从运行中的容器 将 /usr/local/swoole-cli/ 文件夹 拷贝出来 并生成新容器镜像 ,并把新容器镜像导出为文件

COMMENT

Expand All @@ -19,6 +20,7 @@ cd ${__PROJECT__}


CONTAINER_BASE_IMAGE='docker.io/library/alpine:3.18'
CONTAIENR_NAME='swoole-cli-builder'
MIRROR=''
PLATFORM=''
ARCH=$(uname -m)
Expand All @@ -39,6 +41,10 @@ while [ $# -gt 0 ]; do
--mirror)
MIRROR="$2"
;;
--quickstart-container)
CONTAIENR_NAME='swoole-cli-alpine-dev'
# 从quickstart 生成的容器中拷贝 /usr/local/swoole-cli/ 文件夹,并生成新容器镜像
;;
--*)
echo "Illegal option $1"
;;
Expand All @@ -58,8 +64,8 @@ cd ${__PROJECT__}/var/build-export-container/

test -d swoole-cli && rm -rf swoole-cli

container_id='swoole-cli-builder'
docker cp $container_id:/usr/local/swoole-cli/ .

docker cp ${CONTAIENR_NAME}:/usr/local/swoole-cli/ .


cat > Dockerfile <<'EOF'
Expand Down Expand Up @@ -99,7 +105,7 @@ IMAGE="docker.io/phpswoole/swoole-cli-builder:${TAG}"

echo "MIRROR=${MIRROR}"
echo "BASE_IMAGE=${CONTAINER_BASE_IMAGE}"
docker build -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}"
docker build --no-cache -t ${IMAGE} -f ./Dockerfile . --progress=plain --platform ${PLATFORM} --build-arg="MIRROR=${MIRROR}" --build-arg="BASE_IMAGE=${CONTAINER_BASE_IMAGE}"

echo ${IMAGE}
echo ${IMAGE} > container-image.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$poject_dir = realpath(__DIR__ . '/../');
$poject_dir = realpath(__DIR__ . '/../../');
$php_version_tag = trim(file_get_contents($poject_dir . '/sapi/PHP-VERSION.conf'));
define("PHP_SRC_DIR", $poject_dir . "/var/php-{$php_version_tag}");
$php_source_folder = PHP_SRC_DIR;
Expand Down
2 changes: 1 addition & 1 deletion sync-source-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

$project_dir = __DIR__;
require_once __DIR__ . '/sapi/DownloadPHPSourceCode.php';
require_once __DIR__ . '/sapi/scripts/DownloadPHPSourceCode.php';
$php_source_folder = PHP_SRC_DIR;
$sync_dest_dir = $project_dir . '/var/sync-source-code-tmp';

Expand Down
Loading