{"id":42765040,"url":"https://github.com/openswoole/docker-openswoole","last_synced_at":"2026-01-29T21:09:50.106Z","repository":{"id":39652597,"uuid":"416691590","full_name":"openswoole/docker-openswoole","owner":"openswoole","description":"Docker image for Open Swoole","archived":false,"fork":false,"pushed_at":"2025-02-03T16:17:47.000Z","size":1299,"stargazers_count":42,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-03T16:28:01.281Z","etag":null,"topics":["alpine","docker","docker-image","openswoole","php"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/openswoole/swoole","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openswoole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-13T10:25:33.000Z","updated_at":"2024-11-17T14:36:23.000Z","dependencies_parsed_at":"2025-02-03T16:25:22.678Z","dependency_job_id":"2d638f64-ffb7-496c-8a61-e15d0a7629fd","html_url":"https://github.com/openswoole/docker-openswoole","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openswoole/docker-openswoole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openswoole%2Fdocker-openswoole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openswoole%2Fdocker-openswoole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openswoole%2Fdocker-openswoole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openswoole%2Fdocker-openswoole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openswoole","download_url":"https://codeload.github.com/openswoole/docker-openswoole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openswoole%2Fdocker-openswoole/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28885038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine","docker","docker-image","openswoole","php"],"created_at":"2026-01-29T21:09:48.072Z","updated_at":"2026-01-29T21:09:50.100Z","avatar_url":"https://github.com/openswoole.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Image for OpenSwoole\n\n[![Tests](https://github.com/openswoole/docker-swoole/workflows/Tests/badge.svg)](https://github.com/openswoole/docker-swoole/actions)\n[![Docker Pulls](https://img.shields.io/docker/pulls/openswoole/swoole.svg)](https://hub.docker.com/r/openswoole/swoole)\n[![License](https://img.shields.io/badge/license-apache2-blue.svg)](https://github.com/openswoole/docker-swoole/blob/master/LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/openswoole/docker-swoole)](https://github.com/openswoole/docker-swoole/stargazers)\n[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/openswoole.svg?style=social\u0026label=Follow%20%40OpenSwoole)](https://twitter.com/openswoole)\n\n[![Versioned Images](https://github.com/openswoole/docker-swoole/actions/workflows/build_versioned_images.yml/badge.svg)](https://github.com/openswoole/docker-swoole/actions/workflows/build_versioned_images.yml)\n[![Versioned Alpine Images](https://github.com/openswoole/docker-swoole/actions/workflows/build_versioned_alpine_images.yml/badge.svg)](https://github.com/openswoole/docker-swoole/actions/workflows/build_versioned_alpine_images.yml)\n[![Latest Images](https://github.com/openswoole/docker-swoole/actions/workflows/build_latest_images.yml/badge.svg)](https://github.com/openswoole/docker-swoole/actions/workflows/build_latest_images.yml)\n[![Latest Alpine Images](https://github.com/openswoole/docker-swoole/actions/workflows/build_latest_alpine_images.yml/badge.svg)](https://github.com/openswoole/docker-swoole/actions/workflows/build_latest_alpine_images.yml)\n\nThis image is built for general-purpose. We have different examples included in this Git repository to help developers\nto get familiar with the image and _OpenSwoole_.\n\nYou can get the image from [Docker Hub](https://hub.docker.com/r/openswoole/swoole).\n\n\u003e Latest released version `:22.1.2` for PHP8.1/PHP8.2/PHP8.3\n\nTable of Contents\n=================\n\n   * [Feature List](#feature-list)\n   * [How to Use This Image](#how-to-use-this-image)\n      * [How to Install More PHP Extensions](#how-to-install-more-php-extensions)\n      * [More Examples](#more-examples)\n   * [Image Variants](#image-variants)\n   * [Supported Tags and Respective Dockerfile Links](#supported-tags-and-respective-dockerfile-links)\n      * [Versioned images](#versioned-images-based-on-stable-releases-of-swoole)\n         * [OpenSwoole 4.7](#swoole-47)\n      * [Nightly images](#nightly-images-built-daily-using-the-master-branch-of-swoole-src)\n   * [Build Images Manually](#build-images-manually)\n   * [Credits](#credits)\n\n# Feature List\n\n* Built-in scripts to manage _OpenSwoole_ extensions and _Supervisord_ programs.\n* Easy to manage booting scripts in Docker.\n* Allow running PHP scripts and other commands directly in different environments (including ECS).\n* Use one root filesystem for simplicity (one Docker `COPY` command only in dockerfiles).\n* _Composer v2_ for OpenSwoole 4.7.2 and after).\n* Built for different architectures.\n* Support auto-reloading for local development.\n* Support code debugging for local development.\n\n# How to Use This Image\n\nThe `openswoole/swoole` image is built using [the official PHP image](https://hub.docker.com/_/php) as base image, with a few changes.\nFor basic usage, please check the description section of [the official PHP image](https://hub.docker.com/_/php).\n\n## How to Install More PHP Extensions\n\nSame as in the official PHP image, most PHP extensions can be installed/configured using built-in helper scripts `docker-php-ext-configure`, `docker-php-ext-install`, `docker-php-ext-enable`, and `docker-php-source`. Here are some examples.\n\n```Dockerfile\n# To install the MySQL extensions.\nFROM openswoole/swoole:4.12-php7.4-alpine\n\nRUN docker-php-ext-install mysqli pdo_mysql\n```\n\n```Dockerfile\n# To install the Redis extension.\nFROM openswoole/swoole:4.12-php7.4-alpine\n\nRUN set -ex \\\n    \u0026\u0026 pecl update-channels \\\n    \u0026\u0026 pecl install redis-stable \\\n    \u0026\u0026 docker-php-ext-enable redis\n```\n\n```Dockerfile\n# To install the Couchbase extension.\nFROM openswoole/swoole:4.12-php7.4-alpine\n\nRUN set -ex \\\n    \u0026\u0026 apk update \\\n    \u0026\u0026 apk add --no-cache libcouchbase=2.10.6-r0 \\\n    \u0026\u0026 apk add --no-cache --virtual .build-deps $PHPIZE_DEPS libcouchbase-dev=2.10.6-r0 zlib-dev \\\n    \u0026\u0026 pecl update-channels \\\n    \u0026\u0026 pecl install couchbase-2.6.2 \\\n    \u0026\u0026 docker-php-ext-enable couchbase \\\n    \u0026\u0026 apk del .build-deps \\\n    \u0026\u0026 rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/src/php.tar.xz*\n```\n\n## More Examples\n\n**Following examples are for non-Alpine images only**. We don't have examples included for the Alpine images.\n\nYou can use the image to serve an HTTP/WebSocket server, or run some one-off command with it. e.g.,\n\n```bash\ndocker run --rm openswoole/swoole \"php -m\"\ndocker run --rm openswoole/swoole \"php --ri openswoole\"\ndocker run --rm openswoole/swoole \"composer --version\"\n```\n\nWe have various examples included under folder \"_examples/_\" to help developers better use the image. These examples are\nnumerically ordered. Each example has a _docker-compose.yml_ file included, along with some other files. To run an\nexample, please start Docker containers using the _docker-compose.yml_ file included, then check HTTP output from URL\nhttp://127.0.0.1 unless otherwise noted. You may use the following commands to start/stop/restart Docker containers:\n\n```bash\n./bin/example.sh start   00 # To start container(s) of the first example.\n./bin/example.sh stop    00 # To stop container(s) of the first example.\n./bin/example.sh restart 00 # To restart container(s) of the first example.\n```\n\nTo run another example, just replace the last command line parameter _00_ with an example number (e.g., _05_).\n\nHere is a list of the examples under folder \"_examples/_\":\n\n* Basic examples:\n    * **00-autoload**: Restart the Swoole web server automatically if file changes detected under web root.\n    * **01-basic**: print out \"Hello, World!\" using Swoole as backend HTTP server.\n    * **02-www**: to use some customized PHP script(s) in the Docker image built.\n    * **03-nginx**: to use Swoole behind an Nginx server.\n    * **04-entrypoint**: to use a self-defined entrypoint script in the Docker image built.\n    * **05-boot**: to update content in the Docker container through a booting script.\n    * **06-update-token**: to show how to update server configurations with built-in script _update-token.sh_.\n    * **07-disable-default-server**: Please check the [docker-compose.yml](https://github.com/openswoole/docker-swoole/blob/master/examples/07-disable-default-server/docker-compose.yml) file included to see show how to disable the default web server created with _Swoole_.\n* Manage PHP extensions and configurations:\n    * **10-install-php-extension**: how to install/enable PHP extensions.\n    * **11-customize-extension-options**: how to overwrite/customize PHP extension options.\n    * **12-php.ini**: how to overwrite/customize PHP options.\n    * **13-install-swoole-extension**: Please check the [README](https://github.com/openswoole/docker-swoole/tree/master/examples/13-install-swoole-extension) file included to see how to install Swoole extensions like [postgresql](https://github.com/openswoole/ext-postgresql).\n* Manage Supervisord programs:\n    * **20-supervisord-services**: to show how to run Supervisord program(s) in Docker.\n    * **21-supervisord-tasks**: to show how to run Supervisord program(s) when launching a one-off command with Docker. Please check the [README](https://github.com/openswoole/docker-swoole/tree/master/examples/21-supervisord-tasks) file included to see how to run the example.\n    * **22-supervisord-enable-program**: to show how to enable program(s) in Supervisord program.\n    * **23-supervisord-disable-program**: to show how to disable Supervisord program(s).\n* Debugging:\n    * **30-debug-with-gdb**: Please check the [README](https://github.com/openswoole/docker-swoole/tree/master/examples/30-debug-with-gdb) file included to see how to debug your PHP code with _gdb_.\n    * **31-debug-with-valgrind**: Please check the [README](https://github.com/openswoole/docker-swoole/tree/master/examples/31-debug-with-valgrind) file included to see how to debug your PHP code with _Valgrind_.\n    * **32-debug-with-strace**: Please check the [README](https://github.com/openswoole/docker-swoole/tree/master/examples/32-debug-with-strace) file included to see how to debug your PHP code with _strace_.\n\n# Image Variants\n\nThe `openswoole/swoole` images come in three flavors, each designed for a specific use case. **In production environment, we suggest using the Alpine images.**\n\n### 1. `latest`, `\u003cswoole-version\u003e`, and `\u003cswoole-version\u003e-php\u003cphp-version\u003e`\n\n* `openswoole/swoole:latest`\n* `openswoole/swoole:4.12`\n* `openswoole/swoole:4.12-php8.0`\n* `openswoole/swoole:4.12.0-php8.0`\n\nThis variant is based on the _php:cli_ images, with a few changes. It uses _Supervisord_ to manage booting processes, and has _Composer_ preinstalled.\n\n### 2. `latest-dev`, `\u003cswoole-version\u003e-dev`, and `\u003cswoole-version\u003e-php\u003cphp-version\u003e-dev`\n\n* `openswoole/swoole:latest-dev`\n* `openswoole/swoole:4.12-dev`\n* `openswoole/swoole:4.12-php8.0-dev`\n* `openswoole/swoole:4.12.0-php8.0-dev`\n\nThis variant is very similar to the previous one, but it has extra tools added for testing, debugging, and monitoring purpose,\nincluding [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.\n\n### 3. `latest-alpine`, `\u003cswoole-version\u003e-alpine`, and `\u003cswoole-version\u003e-php\u003cphp-version\u003e-alpine`\n\n* `openswoole/swoole:latest-alpine`\n* `openswoole/swoole:4.12-alpine`\n* `openswoole/swoole:4.12-php8.0-alpine`\n* `openswoole/swoole:4.12.0-php8.0-alpine`\n\nYou 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_.\nAlso, we have _Composer_ preinstalled in the image.\n\nNote: We don't have development tools built in for Alpine images. There is no Docker images like `openswoole/swoole:4.9.1-php8.1-alpine-dev`.\n\n# Supported Tags and Respective `Dockerfile` Links\n\n## Versioned images (based on stable releases of Swoole)\n\n### Open Swoole 4.12\n\n| PHP Versions | Default Images | Dev Images | Alpine Images |\n|-|-|-|-|\n| PHP 8.1 | [4.12.0-php8.1, 4.12-php8.1\u003cbr /\u003e4.12, latest](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php8.1/cli/Dockerfile) | [4.12.0-php8.1-dev, 4.12-php8.1-dev\u003cbr /\u003e4.12-dev, latest-dev](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php8.1/cli/Dockerfile) | [4.12.0-php8.1-alpine, 4.12-php8.1-alpine\u003cbr /\u003e4.12-alpine, latest-alpine](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php8.1/alpine/Dockerfile) |\n| PHP 8.0 | [4.12.0-php8.0, 4.12-php8.0\u003cbr /\u003e4.12, latest](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php8.0/cli/Dockerfile) | [4.12.0-php8.0-dev, 4.12-php8.0-dev\u003cbr /\u003e4.12-dev, latest-dev](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php8.0/cli/Dockerfile) | [4.12.0-php8.0-alpine, 4.12-php8.0-alpine\u003cbr /\u003e4.12-alpine, latest-alpine](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php8.0/alpine/Dockerfile) |\n| PHP 7.4 | [4.12.0-php7.4, 4.12-php7.4](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.4/cli/Dockerfile) | [4.12.0-php7.4-dev, 4.12-php7.4-dev](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.4/cli/Dockerfile) | [4.12.0-php7.4-alpine, 4.12-php7.4-alpine](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.4/alpine/Dockerfile) |\n| PHP 7.3 | [4.12.0-php7.3, 4.12-php7.3](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.3/cli/Dockerfile) | [4.12.0-php7.3-dev, 4.12-php7.3-dev](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.3/cli/Dockerfile) | [4.12.0-php7.3-alpine, 4.12-php7.3-alpine](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.3/alpine/Dockerfile) |\n| PHP 7.2 | [4.12.0-php7.2, 4.12-php7.2](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.2/cli/Dockerfile) | [4.12.0-php7.2-dev, 4.12-php7.2-dev](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.2/cli/Dockerfile) | [4.12.0-php7.2-alpine, 4.12-php7.2-alpine](https://github.com/openswoole/docker-swoole/blob/master/dockerfiles/4.12.0/php7.2/alpine/Dockerfile) |\n\n# Build Images Manually\n\nThe Docker images are built and pushed out automatically through Travis. If you want to build some image manually, please\nfollow these three steps.\n\n**1**. Install Composer packages. If you have command \"composer\" installed already, just run `composer update -n`.\n\n**2**. Use commands like following to create dockerfiles:\n\n```bash\n./bin/generate-dockerfiles.php latest # Generate dockerfiles to build images from the master branch of Open Swoole.\n./bin/generate-dockerfiles.php 4.12.0  # Generate dockerfiles to build images for Open Swoole 4.12.0.\n```\n\n**3**. Build Docker images with commands like:\n\n```bash\ndocker build -t openswoole/swoole                     -f dockerfiles/latest/php8.0/cli/Dockerfile   .\ndocker build -t openswoole/swoole:4.12.0-php8.0        -f dockerfiles/4.12.0/php8.0/cli/Dockerfile    .\ndocker build -t openswoole/swoole:4.12.0-php8.0-alpine -f dockerfiles/4.12.0/php8.0/alpine/Dockerfile .\n```\n\nTo build development images (where extra tools are included), add an argument _DEV_MODE_:\n\n```bash\ndocker build --build-arg DEV_MODE=true -t openswoole/swoole:latest-dev       -f dockerfiles/latest/php8.0/cli/Dockerfile .\ndocker build --build-arg DEV_MODE=true -t openswoole/swoole:4.12.0-php8.0-dev -f dockerfiles/4.12.0/php8.0/cli/Dockerfile  .\n```\n\n# Credits\n\nOrignal implementation was done by [Demin](https://github.com/deminy) at [Glu Mobile](https://glu.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenswoole%2Fdocker-openswoole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenswoole%2Fdocker-openswoole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenswoole%2Fdocker-openswoole/lists"}