Skip to content

Commit

Permalink
feat: add php8.1.31 swoole images
Browse files Browse the repository at this point in the history
  • Loading branch information
huanglonghui committed Dec 13, 2024
1 parent 4a155fd commit 8eeee9f
Show file tree
Hide file tree
Showing 6 changed files with 291 additions and 31 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/publish_base_alpine_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ jobs:
# - php-prefix: "8"
# php: "8.1.27"
# alpine: "3.18"
- php-prefix: "8"
php: "8.1.31"
alpine: "3.19"
# - php-prefix: "8"
# php: "8.1.31"
# alpine: "3.19"
# - php-prefix: "8"
# php: "8.2.17"
# alpine: "3.19"
- php-prefix: "8"
php: "8.2.26"
alpine: "3.21"
# - php-prefix: "8"
# php: "8.2.26"
# alpine: "3.21"
# - php-prefix: "8"
# php: "8.3.4"
# alpine: "3.19"
- php-prefix: "8"
php: "8.3.14"
alpine: "3.21"
- php-prefix: "8"
php: "8.4.1"
alpine: "3.21"
# - php-prefix: "8"
# php: "8.3.14"
# alpine: "3.21"
# - php-prefix: "8"
# php: "8.4.1"
# alpine: "3.21"

steps:
- name: Checkout
Expand Down
47 changes: 28 additions & 19 deletions .github/workflows/publish_versioned_alpine_image_php81.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build Versioned Alpine Images for EasySwoole PHP 8.1

#on:
# push:
# branches:
# - 'main'
on:
push:
branches:
- 'main'

jobs:
build_versioned_alpine_images:
Expand All @@ -12,23 +12,32 @@ jobs:
strategy:
matrix:
include:
- php: 8.1.22
alpine: 3.16
# - php: 8.1.22
# alpine: 3.16
# swoole: "4.8.13"
# - php: 8.1.22
# alpine: 3.16
# swoole: "5.0.3"
# - php: 8.1.22
# alpine: 3.16
# swoole: "5.1.1"
# - php: 8.1.27
# alpine: 3.18
# swoole: "4.8.13"
# - php: 8.1.27
# alpine: 3.18
# swoole: "5.0.3"
# - php: 8.1.27
# alpine: 3.18
# swoole: "5.1.1"
- php: 8.1.31
alpine: 3.19
swoole: "4.8.13"
- php: 8.1.22
alpine: 3.16
- php: 8.1.31
alpine: 3.19
swoole: "5.0.3"
- php: 8.1.22
alpine: 3.16
swoole: "5.1.1"
- php: 8.1.27
alpine: 3.18
swoole: "4.8.13"
- php: 8.1.27
alpine: 3.18
swoole: "5.0.3"
- php: 8.1.27
alpine: 3.18
- php: 8.1.31
alpine: 3.19
swoole: "5.1.1"

name: The Alpine Image For EasySwoole PHP-${{ matrix.php }} Swoole-${{ matrix.swoole }}
Expand Down
61 changes: 61 additions & 0 deletions dockerfiles/php8/8.1.31/alpine/3.19/swoole/4.8.13/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Build image for easyswoolexuesi2021/easyswoole:php8.1.31-alpine3.19-swoole4.8.13
#
# @link https://www.easyswoole.com
# @document https://www.easyswoole.com
# @contact https://www.easyswoole.com
# @license https://github.com/easy-swoole/easyswoole/blob/3.x/LICENSE

FROM easyswoolexuesi2021/php:8.1.31-alpine3.19-base

LABEL maintainer="EasySwoole Developers https://www.easyswoole.com" version="1.0" license="Apache 2.0"

##
# ---------- env settings ----------
##
ENV PHP_BUILD_VERSION="81"
ENV SWOOLE_VERSION="4.8.13" \
COMPOSER_VERSION="2.3.10" \
# install and remove building packages
PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make php${PHP_BUILD_VERSION}-dev php${PHP_BUILD_VERSION}-pear pkgconf re2c pcre-dev pcre2-dev zlib-dev libtool automake libaio-dev openssl-dev curl-dev"

# update
RUN set -ex \
&& apk update \
# for swoole extension libaio linux-headers
&& apk add --no-cache libstdc++ openssl git bash c-ares-dev libpq-dev \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
# download
&& cd /tmp \
&& curl -SL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \
&& ls -alh \
# php extension:swoole
&& cd /tmp \
&& mkdir -p swoole \
&& tar -xf swoole.tar.gz -C swoole --strip-components=1 \
&& ln -s /usr/bin/phpize${PHP_BUILD_VERSION} /usr/local/bin/phpize \
&& ln -s /usr/bin/php-config${PHP_BUILD_VERSION} /usr/local/bin/php-config \
&& ( \
cd swoole \
&& phpize \
&& ./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql \
&& make -s -j$(nproc) && make install \
) \
&& echo "memory_limit=1G" > /etc/php${PHP_BUILD_VERSION}/conf.d/00_default.ini \
&& echo "opcache.enable_cli = 'On'" >> /etc/php${PHP_BUILD_VERSION}/conf.d/00_opcache.ini \
&& echo "extension=swoole.so" > /etc/php${PHP_BUILD_VERSION}/conf.d/50_swoole.ini \
# install composer
&& wget -nv -O /usr/local/bin/composer https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \
&& chmod u+x /usr/local/bin/composer \
# ---------- clear works ----------
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/local/bin/php* \
# php info
&& php -v \
&& php -m \
&& php --ri swoole \
&& php --ri Zend\ OPcache \
&& composer

WORKDIR /var/www

RUN echo -e "\033[42;37m Build Completed :).\033[0m\n"
61 changes: 61 additions & 0 deletions dockerfiles/php8/8.1.31/alpine/3.19/swoole/5.0.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Build image for easyswoolexuesi2021/easyswoole:php8.1.31-alpine3.19-swoole5.0.3
#
# @link https://www.easyswoole.com
# @document https://www.easyswoole.com
# @contact https://www.easyswoole.com
# @license https://github.com/easy-swoole/easyswoole/blob/3.x/LICENSE

FROM easyswoolexuesi2021/php:8.1.31-alpine3.19-base

LABEL maintainer="EasySwoole Developers https://www.easyswoole.com" version="1.0" license="Apache 2.0"

##
# ---------- env settings ----------
##
ENV PHP_BUILD_VERSION="81"
ENV SWOOLE_VERSION="5.0.3" \
COMPOSER_VERSION="2.3.10" \
# install and remove building packages
PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make php${PHP_BUILD_VERSION}-dev php${PHP_BUILD_VERSION}-pear pkgconf re2c pcre-dev pcre2-dev zlib-dev libtool automake libaio-dev openssl-dev curl-dev"

# update
RUN set -ex \
&& apk update \
# for swoole extension libaio linux-headers
&& apk add --no-cache libstdc++ openssl git bash c-ares-dev libpq-dev \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
# download
&& cd /tmp \
&& curl -SL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \
&& ls -alh \
# php extension:swoole
&& cd /tmp \
&& mkdir -p swoole \
&& tar -xf swoole.tar.gz -C swoole --strip-components=1 \
&& ln -s /usr/bin/phpize${PHP_BUILD_VERSION} /usr/local/bin/phpize \
&& ln -s /usr/bin/php-config${PHP_BUILD_VERSION} /usr/local/bin/php-config \
&& ( \
cd swoole \
&& phpize \
&& ./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql \
&& make -s -j$(nproc) && make install \
) \
&& echo "memory_limit=1G" > /etc/php${PHP_BUILD_VERSION}/conf.d/00_default.ini \
&& echo "opcache.enable_cli = 'On'" >> /etc/php${PHP_BUILD_VERSION}/conf.d/00_opcache.ini \
&& echo "extension=swoole.so" > /etc/php${PHP_BUILD_VERSION}/conf.d/50_swoole.ini \
# install composer
&& wget -nv -O /usr/local/bin/composer https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \
&& chmod u+x /usr/local/bin/composer \
# ---------- clear works ----------
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/local/bin/php* \
# php info
&& php -v \
&& php -m \
&& php --ri swoole \
&& php --ri Zend\ OPcache \
&& composer

WORKDIR /var/www

RUN echo -e "\033[42;37m Build Completed :).\033[0m\n"
61 changes: 61 additions & 0 deletions dockerfiles/php8/8.1.31/alpine/3.19/swoole/5.1.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Build image for easyswoolexuesi2021/easyswoole:php8.1.31-alpine3.19-swoole5.1.1
#
# @link https://www.easyswoole.com
# @document https://www.easyswoole.com
# @contact https://www.easyswoole.com
# @license https://github.com/easy-swoole/easyswoole/blob/3.x/LICENSE

FROM easyswoolexuesi2021/php:8.1.31-alpine3.19-base

LABEL maintainer="EasySwoole Developers https://www.easyswoole.com" version="1.0" license="Apache 2.0"

##
# ---------- env settings ----------
##
ENV PHP_BUILD_VERSION="81"
ENV SWOOLE_VERSION="5.1.1" \
COMPOSER_VERSION=${COMPOSER_VERSION:-"2.3.10"} \
# install and remove building packages
PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make php${PHP_BUILD_VERSION}-dev php${PHP_BUILD_VERSION}-pear pkgconf re2c pcre-dev pcre2-dev zlib-dev libtool automake libaio-dev openssl-dev curl-dev"

# update
RUN set -ex \
&& apk update \
# for swoole extension libaio linux-headers
&& apk add --no-cache libstdc++ openssl git bash c-ares-dev libpq-dev \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
# download
&& cd /tmp \
&& curl -SL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \
&& ls -alh \
# php extension:swoole
&& cd /tmp \
&& mkdir -p swoole \
&& tar -xf swoole.tar.gz -C swoole --strip-components=1 \
&& ln -s /usr/bin/phpize${PHP_BUILD_VERSION} /usr/local/bin/phpize \
&& ln -s /usr/bin/php-config${PHP_BUILD_VERSION} /usr/local/bin/php-config \
&& ( \
cd swoole \
&& phpize \
&& ./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql \
&& make -s -j$(nproc) && make install \
) \
&& echo "memory_limit=1G" > /etc/php${PHP_BUILD_VERSION}/conf.d/00_default.ini \
&& echo "opcache.enable_cli = 'On'" >> /etc/php${PHP_BUILD_VERSION}/conf.d/00_opcache.ini \
&& echo "extension=swoole.so" > /etc/php${PHP_BUILD_VERSION}/conf.d/50_swoole.ini \
# install composer
&& wget -nv -O /usr/local/bin/composer https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \
&& chmod u+x /usr/local/bin/composer \
# ---------- clear works ----------
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/local/bin/php* \
# php info
&& php -v \
&& php -m \
&& php --ri swoole \
&& php --ri Zend\ OPcache \
&& composer

WORKDIR /var/www

RUN echo -e "\033[42;37m Build Completed :).\033[0m\n"
68 changes: 68 additions & 0 deletions dockerfiles/php8/8.1.31/alpine/3.19/swoole/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Build image for easyswoolexuesi2021/easyswoole:php8.1.31-alpine3.19-swoole5.1.1
#
# @link https://www.easyswoole.com
# @document https://www.easyswoole.com
# @contact https://www.easyswoole.com
# @license https://github.com/easy-swoole/easyswoole/blob/3.x/LICENSE

FROM easyswoolexuesi2021/php:8.1.31-alpine3.19-base

LABEL maintainer="EasySwoole Developers https://www.easyswoole.com" version="1.0" license="Apache 2.0"

##
# ---------- env settings ----------
##
# --build-arg SWOOLE_VERSION=5.1.1 COMPOSER_VERSION=2.3.10
ARG SWOOLE_VERSION
ARG COMPOSER_VERSION

##
# ---------- env settings ----------
##
ENV PHP_BUILD_VERSION="81"
ENV SWOOLE_VERSION=${SWOOLE_VERSION:-"5.1.1"} \
COMPOSER_VERSION=${COMPOSER_VERSION:-"2.3.10"} \
# install and remove building packages
PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make php${PHP_BUILD_VERSION}-dev php${PHP_BUILD_VERSION}-pear pkgconf re2c pcre-dev pcre2-dev zlib-dev libtool automake libaio-dev openssl-dev curl-dev"

# update
RUN set -ex \
&& apk update \
# for swoole extension libaio linux-headers
&& apk add --no-cache libstdc++ openssl git bash c-ares-dev libpq-dev \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
# download
&& cd /tmp \
&& curl -SL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \
&& ls -alh \
# php extension:swoole
&& cd /tmp \
&& mkdir -p swoole \
&& tar -xf swoole.tar.gz -C swoole --strip-components=1 \
&& ln -s /usr/bin/phpize${PHP_BUILD_VERSION} /usr/local/bin/phpize \
&& ln -s /usr/bin/php-config${PHP_BUILD_VERSION} /usr/local/bin/php-config \
&& ( \
cd swoole \
&& phpize \
&& ./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql \
&& make -s -j$(nproc) && make install \
) \
&& echo "memory_limit=1G" > /etc/php${PHP_BUILD_VERSION}/conf.d/00_default.ini \
&& echo "opcache.enable_cli = 'On'" >> /etc/php${PHP_BUILD_VERSION}/conf.d/00_opcache.ini \
&& echo "extension=swoole.so" > /etc/php${PHP_BUILD_VERSION}/conf.d/50_swoole.ini \
# install composer
&& wget -nv -O /usr/local/bin/composer https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \
&& chmod u+x /usr/local/bin/composer \
# ---------- clear works ----------
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/local/bin/php* \
# php info
&& php -v \
&& php -m \
&& php --ri swoole \
&& php --ri Zend\ OPcache \
&& composer

WORKDIR /var/www

RUN echo -e "\033[42;37m Build Completed :).\033[0m\n"

0 comments on commit 8eeee9f

Please sign in to comment.