Skip to content

Commit

Permalink
build Swoole 4.8.10 images
Browse files Browse the repository at this point in the history
  • Loading branch information
deminy committed May 12, 2022
1 parent 522eaff commit c30cc41
Show file tree
Hide file tree
Showing 13 changed files with 324 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Table of Contents
=================

* [Swoole 4.8](#swoole-48)
* [4.8.10](#4810)
* [4.8.9](#489)
* [4.8.8](#488)
* [4.8.7](#487)
Expand Down Expand Up @@ -58,6 +59,8 @@ Table of Contents

# Swoole 4.8

## 4.8.10

## 4.8.9

### Changed
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ The `phpswoole/swoole` images come in three flavors, each designed for a specifi
* `phpswoole/swoole:latest`
* `phpswoole/swoole:4.8`
* `phpswoole/swoole:4.8-php8.0`
* `phpswoole/swoole:4.8.9-php8.0`
* `phpswoole/swoole:4.8.10-php8.0`

This variant is based on the _php:cli_ images, with a few changes. It uses _Supervisord_ to manage booting processes, and has _Composer_ preinstalled.

Expand All @@ -155,7 +155,7 @@ This variant is based on the _php:cli_ images, with a few changes. It uses _Supe
* `phpswoole/swoole:latest-dev`
* `phpswoole/swoole:4.8-dev`
* `phpswoole/swoole:4.8-php8.0-dev`
* `phpswoole/swoole:4.8.9-php8.0-dev`
* `phpswoole/swoole:4.8.10-php8.0-dev`

This variant is very similar to the previous one, but it has extra tools added for testing, debugging, and monitoring purpose,
including [gdb](https://www.gnu.org/s/gdb), git, lsof, [strace](https://strace.io), [tcpdump](https://www.tcpdump.org), [Valgrind](http://www.valgrind.org), and vim.
Expand All @@ -165,12 +165,12 @@ including [gdb](https://www.gnu.org/s/gdb), git, lsof, [strace](https://strace.i
* `phpswoole/swoole:latest-alpine`
* `phpswoole/swoole:4.8-alpine`
* `phpswoole/swoole:4.8-php8.0-alpine`
* `phpswoole/swoole:4.8.9-php8.0-alpine`
* `phpswoole/swoole:4.8.10-php8.0-alpine`

You can use this variant in the same way as using the _php:alpine_ image, except that we changed the default working directory to _/var/www_.
Also, we have _Composer_ preinstalled in the image.

Note: We don't have development tools built in for Alpine images. There is no Docker images like `phpswoole/swoole:4.8.9-php8.1-alpine-dev`.
Note: We don't have development tools built in for Alpine images. There is no Docker images like `phpswoole/swoole:4.8.10-php8.1-alpine-dev`.

# Supported Tags and Respective `Dockerfile` Links

Expand All @@ -180,11 +180,11 @@ Note: We don't have development tools built in for Alpine images. There is no Do

| PHP Versions | Default Images | Dev Images | Alpine Images |
|-|-|-|-|
| PHP 8.1 | [4.8.9-php8.1, 4.8-php8.1](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php8.1/cli/Dockerfile) | [4.8.9-php8.1-dev, 4.8-php8.1-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php8.1/cli/Dockerfile) | [4.8.9-php8.1-alpine, 4.8-php8.1-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php8.1/alpine/Dockerfile) |
| PHP 8.0 | [4.8.9-php8.0, 4.8-php8.0<br />4.8, latest](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php8.0/cli/Dockerfile) | [4.8.9-php8.0-dev, 4.8-php8.0-dev<br />4.8-dev, latest-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php8.0/cli/Dockerfile) | [4.8.9-php8.0-alpine, 4.8-php8.0-alpine<br />4.8-alpine, latest-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php8.0/alpine/Dockerfile) |
| PHP 7.4 | [4.8.9-php7.4, 4.8-php7.4](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.4/cli/Dockerfile) | [4.8.9-php7.4-dev, 4.8-php7.4-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.4/cli/Dockerfile) | [4.8.9-php7.4-alpine, 4.8-php7.4-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.4/alpine/Dockerfile) |
| PHP 7.3 | [4.8.9-php7.3, 4.8-php7.3](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.3/cli/Dockerfile) | [4.8.9-php7.3-dev, 4.8-php7.3-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.3/cli/Dockerfile) | [4.8.9-php7.3-alpine, 4.8-php7.3-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.3/alpine/Dockerfile) |
| PHP 7.2 | [4.8.9-php7.2, 4.8-php7.2](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.2/cli/Dockerfile) | [4.8.9-php7.2-dev, 4.8-php7.2-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.2/cli/Dockerfile) | [4.8.9-php7.2-alpine, 4.8-php7.2-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.9/php7.2/alpine/Dockerfile) |
| PHP 8.1 | [4.8.10-php8.1, 4.8-php8.1](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php8.1/cli/Dockerfile) | [4.8.10-php8.1-dev, 4.8-php8.1-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php8.1/cli/Dockerfile) | [4.8.10-php8.1-alpine, 4.8-php8.1-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php8.1/alpine/Dockerfile) |
| PHP 8.0 | [4.8.10-php8.0, 4.8-php8.0<br />4.8, latest](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php8.0/cli/Dockerfile) | [4.8.10-php8.0-dev, 4.8-php8.0-dev<br />4.8-dev, latest-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php8.0/cli/Dockerfile) | [4.8.10-php8.0-alpine, 4.8-php8.0-alpine<br />4.8-alpine, latest-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php8.0/alpine/Dockerfile) |
| PHP 7.4 | [4.8.10-php7.4, 4.8-php7.4](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.4/cli/Dockerfile) | [4.8.10-php7.4-dev, 4.8-php7.4-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.4/cli/Dockerfile) | [4.8.10-php7.4-alpine, 4.8-php7.4-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.4/alpine/Dockerfile) |
| PHP 7.3 | [4.8.10-php7.3, 4.8-php7.3](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.3/cli/Dockerfile) | [4.8.10-php7.3-dev, 4.8-php7.3-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.3/cli/Dockerfile) | [4.8.10-php7.3-alpine, 4.8-php7.3-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.3/alpine/Dockerfile) |
| PHP 7.2 | [4.8.10-php7.2, 4.8-php7.2](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.2/cli/Dockerfile) | [4.8.10-php7.2-dev, 4.8-php7.2-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.2/cli/Dockerfile) | [4.8.10-php7.2-alpine, 4.8-php7.2-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/4.8.10/php7.2/alpine/Dockerfile) |

### Swoole 4.7

Expand Down Expand Up @@ -244,22 +244,22 @@ follow these three steps.

```bash
./bin/generate-dockerfiles.php latest # Generate dockerfiles to build images from the master branch of Swoole.
./bin/generate-dockerfiles.php 4.8.9 # Generate dockerfiles to build images for Swoole 4.8.9.
./bin/generate-dockerfiles.php 4.8.10 # Generate dockerfiles to build images for Swoole 4.8.10.
```

**3**. Build Docker images with commands like:

```bash
docker build -t phpswoole/swoole -f dockerfiles/latest/php8.0/cli/Dockerfile .
docker build -t phpswoole/swoole:4.8.9-php8.0 -f dockerfiles/4.8.9/php8.0/cli/Dockerfile .
docker build -t phpswoole/swoole:4.8.9-php8.0-alpine -f dockerfiles/4.8.9/php8.0/alpine/Dockerfile .
docker build -t phpswoole/swoole:4.8.10-php8.0 -f dockerfiles/4.8.10/php8.0/cli/Dockerfile .
docker build -t phpswoole/swoole:4.8.10-php8.0-alpine -f dockerfiles/4.8.10/php8.0/alpine/Dockerfile .
```

To build development images (where extra tools are included), add an argument _DEV_MODE_:

```bash
docker build --build-arg DEV_MODE=true -t phpswoole/swoole:latest-dev -f dockerfiles/latest/php8.0/cli/Dockerfile .
docker build --build-arg DEV_MODE=true -t phpswoole/swoole:4.8.9-php8.0-dev -f dockerfiles/4.8.9/php8.0/cli/Dockerfile .
docker build --build-arg DEV_MODE=true -t phpswoole/swoole:4.8.10-php8.0-dev -f dockerfiles/4.8.10/php8.0/cli/Dockerfile .
```

# Credits
Expand Down
13 changes: 13 additions & 0 deletions config/4.8.10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# The YAML configuration file for generating Dockerfile of image phpswoole/swoole:4.8.10.
# For technical details of the configuration file, please check comments and sample configurations in file /config.yml.
#
status: "under development"
php:
- "7.2.34"
- "7.3.33"
- "7.4.29"
- "8.0.19"
- "8.1.6"
image:
composer:
version: "2.2.12"
25 changes: 25 additions & 0 deletions dockerfiles/4.8.10/php7.2/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM php:7.2.34-cli-alpine3.12

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.2.12 && \
apk update && \
apk add --no-cache libstdc++ && \
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/swoole && \
curl -sfL https://github.com/swoole/swoole-src/archive/v4.8.10.tar.gz -o swoole.tar.gz && \
tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
docker-php-ext-configure swoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
docker-php-ext-install -j$(nproc) swoole && \
rm -f swoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

WORKDIR "/var/www/"
34 changes: 34 additions & 0 deletions dockerfiles/4.8.10/php7.2/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM php:7.2.34-cli

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-color

ARG DEV_MODE
ENV DEV_MODE $DEV_MODE

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.2.12 && \
apt-get update && \
apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
supervisor \
unzip \
zlib1g-dev \
--no-install-recommends && \
install-swoole.sh 4.8.10 \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
mkdir -p /var/log/supervisor && \
rm -rf /var/lib/apt/lists/* $HOME/.composer/*-old.phar /usr/bin/qemu-*-static

ENTRYPOINT ["/entrypoint.sh"]
CMD []

WORKDIR "/var/www/"
25 changes: 25 additions & 0 deletions dockerfiles/4.8.10/php7.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM php:7.3.33-cli-alpine3.13

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.2.12 && \
apk update && \
apk add --no-cache libstdc++ && \
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/swoole && \
curl -sfL https://github.com/swoole/swoole-src/archive/v4.8.10.tar.gz -o swoole.tar.gz && \
tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
docker-php-ext-configure swoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
docker-php-ext-install -j$(nproc) swoole && \
rm -f swoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

WORKDIR "/var/www/"
34 changes: 34 additions & 0 deletions dockerfiles/4.8.10/php7.3/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM php:7.3.33-cli

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-color

ARG DEV_MODE
ENV DEV_MODE $DEV_MODE

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.2.12 && \
apt-get update && \
apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
supervisor \
unzip \
zlib1g-dev \
--no-install-recommends && \
install-swoole.sh 4.8.10 \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
mkdir -p /var/log/supervisor && \
rm -rf /var/lib/apt/lists/* $HOME/.composer/*-old.phar /usr/bin/qemu-*-static

ENTRYPOINT ["/entrypoint.sh"]
CMD []

WORKDIR "/var/www/"
25 changes: 25 additions & 0 deletions dockerfiles/4.8.10/php7.4/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM php:7.4.29-cli-alpine3.15

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.2.12 && \
apk update && \
apk add --no-cache libstdc++ && \
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/swoole && \
curl -sfL https://github.com/swoole/swoole-src/archive/v4.8.10.tar.gz -o swoole.tar.gz && \
tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
docker-php-ext-configure swoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
docker-php-ext-install -j$(nproc) swoole && \
rm -f swoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

WORKDIR "/var/www/"
34 changes: 34 additions & 0 deletions dockerfiles/4.8.10/php7.4/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM php:7.4.29-cli

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-color

ARG DEV_MODE
ENV DEV_MODE $DEV_MODE

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.2.12 && \
apt-get update && \
apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
supervisor \
unzip \
zlib1g-dev \
--no-install-recommends && \
install-swoole.sh 4.8.10 \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
mkdir -p /var/log/supervisor && \
rm -rf /var/lib/apt/lists/* $HOME/.composer/*-old.phar /usr/bin/qemu-*-static

ENTRYPOINT ["/entrypoint.sh"]
CMD []

WORKDIR "/var/www/"
25 changes: 25 additions & 0 deletions dockerfiles/4.8.10/php8.0/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM php:8.0.19-cli-alpine3.15

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.2.12 && \
apk update && \
apk add --no-cache libstdc++ && \
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/swoole && \
curl -sfL https://github.com/swoole/swoole-src/archive/v4.8.10.tar.gz -o swoole.tar.gz && \
tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
docker-php-ext-configure swoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
docker-php-ext-install -j$(nproc) swoole && \
rm -f swoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

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

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-color

ARG DEV_MODE
ENV DEV_MODE $DEV_MODE

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.2.12 && \
apt-get update && \
apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
supervisor \
unzip \
zlib1g-dev \
--no-install-recommends && \
install-swoole.sh 4.8.10 \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
mkdir -p /var/log/supervisor && \
rm -rf /var/lib/apt/lists/* $HOME/.composer/*-old.phar /usr/bin/qemu-*-static

ENTRYPOINT ["/entrypoint.sh"]
CMD []

WORKDIR "/var/www/"
25 changes: 25 additions & 0 deletions dockerfiles/4.8.10/php8.1/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM php:8.1.6-cli-alpine3.15

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.2.12 && \
apk update && \
apk add --no-cache libstdc++ && \
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/swoole && \
curl -sfL https://github.com/swoole/swoole-src/archive/v4.8.10.tar.gz -o swoole.tar.gz && \
tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
docker-php-ext-configure swoole \
--enable-http2 \
--enable-mysqlnd \
--enable-openssl \
--enable-sockets --enable-swoole-curl --enable-swoole-json && \
docker-php-ext-install -j$(nproc) swoole && \
rm -f swoole.tar.gz $HOME/.composer/*-old.phar && \
docker-php-source delete && \
apk del .build-deps

WORKDIR "/var/www/"
Loading

0 comments on commit c30cc41

Please sign in to comment.