Skip to content

Commit

Permalink
Feature quickstart fix error and format script code (#897)
Browse files Browse the repository at this point in the history
* update quickstart linux connection container config

* format code

* update install-docker.sh

* update make.php
  • Loading branch information
jingjingxyk authored Dec 30, 2024
1 parent b9a7cc7 commit 907d93b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 26 deletions.
12 changes: 7 additions & 5 deletions sapi/quickstart/linux/arm64/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# x86_64 运行 arm64

> 使用 qemu-user-static 实现
## 参考文档

qemu
https://www.qemu.org/
https://github.com/qemu/qemu.git
https://www.qemu.org/
https://github.com/qemu/qemu.git

qemu-user-static
https://github.com/multiarch/qemu-user-static.git
https://github.com/multiarch/qemu-user-static.git

x86 平台利用 qemu-user-static 实现 arm64 平台 docker 镜像的运行和构建
https://www.cnblogs.com/chen2ha/p/17180287.html
https://www.cnblogs.com/chen2ha/p/17180287.html

Docker在x86架构的物理机上跑Qemu-arm 容器
https://blog.csdn.net/sunSHINEEzy/article/details/80015638
https://blog.csdn.net/sunSHINEEzy/article/details/80015638


3 changes: 1 addition & 2 deletions sapi/quickstart/linux/connection-swoole-cli-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ __DIR__=$(

cd ${__DIR__}

docker exec -it swoole-cli-alpine-dev sh

docker exec -it woole-cli-builder sh
3 changes: 1 addition & 2 deletions sapi/quickstart/linux/extra/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#
# 当环境中没有 PHP 解释器时 可以快速安装 PHP 解释器

## 当环境中没有 PHP 解释器时 可以快速安装 PHP 解释器
```bash

# alpine
Expand Down
2 changes: 1 addition & 1 deletion sapi/quickstart/linux/install-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ ! -f /usr/libexec/docker/cli-plugins/docker-compose ]; then

# show more version info
# https://github.com/docker/compose/releases
VERSION="v2.29.1"
VERSION="v2.32.1"

curl -fsSL "https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Expand Down
12 changes: 6 additions & 6 deletions sapi/quickstart/linux/install-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ while [ $# -gt 0 ]; do
shift $(($# > 0 ? 1 : 0))
done


# https://github.com/docker/docker-install.git
# test -f get-docker.sh || curl -fsSL https://get.docker.com -o get-docker.sh

Expand All @@ -41,14 +40,15 @@ china | ustc | tuna)
;;
esac


if [ -n "$http_proxy" ] || [ -n "$https_proxy" ] || [ -n "$HTTP_PROXY" ] || [ -n "$HTTPS_PROXY" ]; then
echo 'Please delete proxy settings !'
echo 'Execute this script again !'
exit 0
set +u
unset http_proxy
unset https_proxy
unset HTTP_PROXY
unset HTTPS_PROXY
set -u
fi


case "$MIRROR" in
china | ustc)
sed -i "s@https://mirrors.aliyun.com/docker-ce@https://mirrors.ustc.edu.cn/docker-ce@g" get-docker.sh
Expand Down
1 change: 0 additions & 1 deletion sapi/quickstart/linux/run-alpine-container-full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ __PROJECT__=$(
cd ${__DIR__}

{
docker stop swoole-cli-alpine-dev
docker stop swoole-cli-builder
sleep 5
} || {
Expand Down
7 changes: 3 additions & 4 deletions sapi/quickstart/linux/run-alpine-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ __PROJECT__=$(
cd ${__DIR__}

{
docker stop swoole-cli-alpine-dev
docker stop swoole-cli-builder
sleep 5
} || {
Expand All @@ -28,9 +27,9 @@ while [ $# -gt 0 ]; do
--mirror)
MIRROR="$2"
case "$MIRROR" in
china | openatom)
IMAGE="hub.atomgit.com/library/alpine:3.18"
;;
china | openatom)
IMAGE="hub.atomgit.com/library/alpine:3.18"
;;
esac
;;
esac
Expand Down
7 changes: 3 additions & 4 deletions sapi/quickstart/linux/run-debian-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ while [ $# -gt 0 ]; do
--mirror)
MIRROR="$2"
case "$MIRROR" in
china | openatom)
IMAGE="hub.atomgit.com/library/debian:12"
;;
china | openatom)
IMAGE="hub.atomgit.com/library/debian:12"
;;
esac
;;
esac
shift $(($# > 0 ? 1 : 0))
done


cd ${__DIR__}
docker run --rm --name swoole-cli-debian-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
2 changes: 1 addition & 1 deletion sapi/src/template/make.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
<?php
/**
* @var $this SwooleCli\Preprocessor
Expand Down

0 comments on commit 907d93b

Please sign in to comment.