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

22.1.1 #40

Merged
merged 5 commits into from
Dec 10, 2023
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 .github/workflows/build_latest_alpine_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ["7.4", "8.0", "8.1", "8.2"]
php: ["8.1", "8.2", "8.3"]

steps:
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_latest_dev_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ["7.4", "8.0", "8.1", "8.2"]
php: ["8.1", "8.2", "8.3"]

steps:
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_latest_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ["7.4", "8.0", "8.1", "8.2"]
php: ["8.1", "8.2", "8.3"]

steps:
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_versioned_alpine_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ["7.4", "8.0", "8.1", "8.2"]
php: ["8.1", "8.2", "8.3"]
swoole47:
- ${{ contains(github.ref, '4.7.') }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_versioned_dev_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ["7.4", "8.0", "8.1", "8.2"]
php: ["8.1", "8.2", "8.3"]
swoole47:
- ${{ contains(github.ref, '4.7.') }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_versioned_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ["7.4", "8.0", "8.1", "8.2"]
php: ["8.1", "8.2", "8.3"]
swoole47:
- ${{ contains(github.ref, '4.7.') }}

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.alpine.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ RUN \
docker-php-ext-install sockets && \
docker-php-source extract && \
mkdir /usr/src/php/ext/openswoole && \
curl -sfL https://github.com/openswoole/swoole-src/archive/{% if swoole_version == "latest" %}{{ latest_version }}{% else %}v{{ swoole_version }}{% endif %}.tar.gz -o swoole.tar.gz && \
tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/openswoole && \
curl -sfL https://github.com/openswoole/ext-openswoole/archive/{% if swoole_version == "latest" %}{{ latest_version }}{% else %}v{{ swoole_version }}{% endif %}.tar.gz -o openswoole.tar.gz && \
tar xfz openswoole.tar.gz --strip-components=1 -C /usr/src/php/ext/openswoole && \
docker-php-ext-configure openswoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets {% if option_curl == true %}--enable-hook-curl {% endif %}{% if option_postgres == true %}--with-postgres {% endif %}&& \
docker-php-ext-install -j$(nproc) --ini-name zzz-docker-php-ext-openswoole.ini openswoole && \
rm -f swoole.tar.gz $HOME/.composer/*-old.phar && \
rm -f openswoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

Expand Down
11 changes: 11 additions & 0 deletions config/22.1.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The YAML configuration file for generating Dockerfile of image openswoole/swoole:4.8.1.
# For technical details of the configuration file, please check comments and sample configurations in file /config.yml.
#
status: "under development"
php:
- "8.1.11"
- "8.2.0"
- "8.3.0"
image:
composer:
version: "2.6.6"
26 changes: 26 additions & 0 deletions dockerfiles/22.1.1/php8.1/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM php:8.1.11-cli-alpine3.16

RUN \
curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
chmod +x /usr/bin/composer && \
composer self-update --clean-backups 2.6.6 && \
apk update && \
apk add --no-cache linux-headers && \
apk add --no-cache libstdc++ postgresql-dev libpq && \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev && \
docker-php-ext-install sockets && \
docker-php-source extract && \
mkdir /usr/src/php/ext/openswoole && \
curl -sfL https://github.com/openswoole/ext-openswoole/archive/v22.1.1.tar.gz -o openswoole.tar.gz && \
tar xfz openswoole.tar.gz --strip-components=1 -C /usr/src/php/ext/openswoole && \
docker-php-ext-configure openswoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-hook-curl --with-postgres && \
docker-php-ext-install -j$(nproc) --ini-name zzz-docker-php-ext-openswoole.ini openswoole && \
rm -f openswoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

WORKDIR "/var/www/"
39 changes: 39 additions & 0 deletions dockerfiles/22.1.1/php8.1/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM php:8.1.11-cli

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-color

ARG DEV_MODE
ENV DEV_MODE $DEV_MODE

ENV TINI_VERSION v0.19.0
RUN dpkgArch="$(dpkg --print-architecture)" && curl -s -L -o /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}
RUN chmod +x /tini

COPY ./rootfilesystem/ /

RUN \
curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
chmod +x /usr/bin/composer && \
composer self-update 2.6.6 && \
apt-get update && \
apt-get install -y \
libcurl4-openssl-dev \
libpq-dev \
libssl-dev \
supervisor \
unzip \
zlib1g-dev \
--no-install-recommends && \
install-swoole.sh 22.1.1 \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-hook-curl --with-postgres && \
mkdir -p /var/log/supervisor && \
rm -rf /var/lib/apt/lists/* $HOME/.composer/*-old.phar /usr/bin/qemu-*-static

ENTRYPOINT ["/tini", "-g", "--", "/entrypoint.sh"]
CMD []

WORKDIR "/var/www/"
26 changes: 26 additions & 0 deletions dockerfiles/22.1.1/php8.2/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM php:8.2.0-cli-alpine3.16

RUN \
curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
chmod +x /usr/bin/composer && \
composer self-update --clean-backups 2.6.6 && \
apk update && \
apk add --no-cache linux-headers && \
apk add --no-cache libstdc++ postgresql-dev libpq && \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev && \
docker-php-ext-install sockets && \
docker-php-source extract && \
mkdir /usr/src/php/ext/openswoole && \
curl -sfL https://github.com/openswoole/ext-openswoole/archive/v22.1.1.tar.gz -o openswoole.tar.gz && \
tar xfz openswoole.tar.gz --strip-components=1 -C /usr/src/php/ext/openswoole && \
docker-php-ext-configure openswoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-hook-curl --with-postgres && \
docker-php-ext-install -j$(nproc) --ini-name zzz-docker-php-ext-openswoole.ini openswoole && \
rm -f openswoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

WORKDIR "/var/www/"
39 changes: 39 additions & 0 deletions dockerfiles/22.1.1/php8.2/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM php:8.2.0-cli

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-color

ARG DEV_MODE
ENV DEV_MODE $DEV_MODE

ENV TINI_VERSION v0.19.0
RUN dpkgArch="$(dpkg --print-architecture)" && curl -s -L -o /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}
RUN chmod +x /tini

COPY ./rootfilesystem/ /

RUN \
curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
chmod +x /usr/bin/composer && \
composer self-update 2.6.6 && \
apt-get update && \
apt-get install -y \
libcurl4-openssl-dev \
libpq-dev \
libssl-dev \
supervisor \
unzip \
zlib1g-dev \
--no-install-recommends && \
install-swoole.sh 22.1.1 \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-hook-curl --with-postgres && \
mkdir -p /var/log/supervisor && \
rm -rf /var/lib/apt/lists/* $HOME/.composer/*-old.phar /usr/bin/qemu-*-static

ENTRYPOINT ["/tini", "-g", "--", "/entrypoint.sh"]
CMD []

WORKDIR "/var/www/"
26 changes: 26 additions & 0 deletions dockerfiles/22.1.1/php8.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM php:8.3.0-cli-alpine3.18

RUN \
curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
chmod +x /usr/bin/composer && \
composer self-update --clean-backups 2.6.6 && \
apk update && \
apk add --no-cache linux-headers && \
apk add --no-cache libstdc++ postgresql-dev libpq && \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev && \
docker-php-ext-install sockets && \
docker-php-source extract && \
mkdir /usr/src/php/ext/openswoole && \
curl -sfL https://github.com/openswoole/ext-openswoole/archive/v22.1.1.tar.gz -o openswoole.tar.gz && \
tar xfz openswoole.tar.gz --strip-components=1 -C /usr/src/php/ext/openswoole && \
docker-php-ext-configure openswoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-hook-curl --with-postgres && \
docker-php-ext-install -j$(nproc) --ini-name zzz-docker-php-ext-openswoole.ini openswoole && \
rm -f openswoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

WORKDIR "/var/www/"
39 changes: 39 additions & 0 deletions dockerfiles/22.1.1/php8.3/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM php:8.3.0-cli

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-color

ARG DEV_MODE
ENV DEV_MODE $DEV_MODE

ENV TINI_VERSION v0.19.0
RUN dpkgArch="$(dpkg --print-architecture)" && curl -s -L -o /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}
RUN chmod +x /tini

COPY ./rootfilesystem/ /

RUN \
curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
chmod +x /usr/bin/composer && \
composer self-update 2.6.6 && \
apt-get update && \
apt-get install -y \
libcurl4-openssl-dev \
libpq-dev \
libssl-dev \
supervisor \
unzip \
zlib1g-dev \
--no-install-recommends && \
install-swoole.sh 22.1.1 \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-hook-curl --with-postgres && \
mkdir -p /var/log/supervisor && \
rm -rf /var/lib/apt/lists/* $HOME/.composer/*-old.phar /usr/bin/qemu-*-static

ENTRYPOINT ["/tini", "-g", "--", "/entrypoint.sh"]
CMD []

WORKDIR "/var/www/"
8 changes: 4 additions & 4 deletions rootfilesystem/usr/local/bin/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function download()
fi

project_name=$1
if [[ "swoole-src" = "${project_name}" ]] ; then
if [[ "ext-openswoole" = "${project_name}" ]] ; then
if [[ ! -d "$(dirname "${SWOOLE_SRC_DIR}")" ]] ; then
echo "Error: Parent folder \"$(dirname "${SWOOLE_SRC_DIR}")\" does not exist."
exit 1
Expand Down Expand Up @@ -110,12 +110,12 @@ function cleanupSwoole()
function initSwooleDir()
{
if [[ -d /usr/src ]] ; then
SWOOLE_SRC_DIR=/usr/src/swoole-src
SWOOLE_SRC_DIR=/usr/src/ext-openswoole
else
if [[ $(pwd) == "/" ]] ; then
SWOOLE_SRC_DIR=/swoole-src
SWOOLE_SRC_DIR=/ext-openswoole
else
SWOOLE_SRC_DIR="$(pwd)/swoole-src"
SWOOLE_SRC_DIR="$(pwd)/ext-openswoole"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion rootfilesystem/usr/local/bin/install-swoole-ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if ! php --ri openswoole ; then
fi

if [[ ! -d "${SWOOLE_SRC_DIR}" ]] ; then
download swoole-src "${SWOOLE_VERSION}"
download ext-openswoole "${SWOOLE_VERSION}"
fi

case "${1}" in
Expand Down
2 changes: 1 addition & 1 deletion rootfilesystem/usr/local/bin/install-swoole.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if [[ "true" = "${DEV_MODE}" ]] ; then
else
DEV_OPTIONS=""
fi
install swoole-src "${SWOOLE_VERSION}" "$@" ${DEV_OPTIONS}
install ext-openswoole "${SWOOLE_VERSION}" "$@" ${DEV_OPTIONS}
if hash docker-php-ext-enable 2>/dev/null ; then
docker-php-ext-enable --ini-name zzz-docker-php-ext-openswoole.ini openswoole
else
Expand Down
9 changes: 5 additions & 4 deletions src/Dockerfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ class Dockerfile
{
protected const ALPINE = 'alpine';
protected const CLI = 'cli';
protected const LATEST_VERSION = 'v22.0.0';
protected const LATEST_VERSION = 'v22.1.1';

protected const ALPINE_VERSIONS = [
// PHP major version => Alpine version,
'7.4' => '3.16',
'8.0' => '3.16',
// '7.4' => '3.16',
// '8.0' => '3.16',
'8.1' => '3.16',
'8.2' => '3.16',
'8.3' => '3.18',
];

protected string $basePath;
Expand Down Expand Up @@ -214,7 +215,7 @@ protected function isValidSwooleVersion(string $swooleVersion): bool
}

/**
* @see https://github.com/swoole/swoole-src/releases/tag/v4.5.7
* @see https://github.com/openswoole/ext-openswoole/releases/tag/v4.5.7
*/
protected function getContext(string $phpVersion): array
{
Expand Down
Loading