Open Swoole 4.8.1 Docker images released with PHP 8.1 support

Published: 3 December 2021

Open Swoole v4.8.1 Docker images are released with support for PHP 8.1. Open Swoole Docker images are bundled based on the Official PHP Docker images at https://hub.docker.com/_/php managed by Docker Inc.


Open Swoole 4.8.1 Docker images released with PHP 8.1 support

You can find the available tags of the Open Swoole Docker Images at Docker Hub: https://hub.docker.com/r/openswoole/swoole. Filter by tags like 'php8.1', 'dev', 'alpine' etc at https://hub.docker.com/r/openswoole/swoole/tags to find the version you like.

Use Open Swoole Docker images

Normally you can use the following command to pull the latest stable version of the Open Swoole Docker image, it is bundled with the latest stable PHP, latest stable Open Swoole and all the features turned on:

docker pull openswoole/swoole
# the same as
docker pull openswoole/swoole:latest
# or use the Apline Linux version
docker pull openswoole/swoole:latest-alpine

Pull Open Swoole Docker images with version tags

# Normal fat Docker image
docker pull openswoole/swoole:4.8.1-php8.1
# Alpine Docker image
docker pull openswoole/swoole:4.8.1-php8.1-alpine

Check the PHP version and Open Swoole version

# check PHP version
docker run openswoole/swoole:4.8.1-php8.1-alpine php -v

PHP 8.1.0 (cli) (built: Nov 30 2021 07:15:23) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.0, Copyright (c) Zend Technologies

# check Open Swoole version
docker run openswoole/swoole:4.8.1-php8.1-alpine php --ri openswoole

openswoole

Open Swoole => enabled
Author => Open Swoole Group & Contributors <[email protected]>
Version => 4.8.1
Built => Dec  1 2021 12:42:05
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1l  24 Aug 2021
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
zlib => 1.2.11
brotli => E16777225/D16777225
mutex_timedlock => enabled
pthread_barrier => enabled
mysqlnd => enabled
async_redis => enabled
postgresql => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 838860

Find the OS information of the Open Swoole Docker images

# check OS version
docker run openswoole/swoole:4.8.1-php8.1 cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

# check Alpine Linux OS version

docker run openswoole/swoole:4.8.1-php8.1-alpine cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.15.0
PRETTY_NAME="Alpine Linux v3.15"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

Run your PHP code in one line

docker run openswoole/swoole:4.8.1-php8.1-alpine php -r 'co\run(function() { echo "Hello Open Swoole ". swoole_version(). "\n"; });'

Why use Open Swoole Docker Images?

In a recent survey at Open Swoole Twitter account, we can see there is still a large percentage of developers not started using Docker:

Docker images enable more efficient use of system resources and standardise your development and production environments. You can speed less time dealing with software library installation and dependency issues, and speed more time working on your project.

You can also bundle your own Open Swoole Images based on your requirement according to the example pre-built Dockerfile at https://github.com/openswoole/docker-swoole/tree/master/dockerfiles.

If you have found any issues, you can look for help by submitting issues at https://github.com/openswoole/docker-swoole/issues.

If you need to install Open Swoole or look at other update methods, checkout the installation documentation and how to update Open Swoole.


How to support Open Swoole
⭐ at Github Follow Twitter Subscribe Newsletter Join Slack Join Discord

Notice: ext-swoole is supported until v4.7.1, use ext-openswoole >= v4.7.1. Latest version: pecl install openswoole-4.9.1