{"id":13404832,"url":"https://github.com/WyriHaximusNet/docker-php","last_synced_at":"2025-03-14T09:31:52.691Z","repository":{"id":37979183,"uuid":"177328781","full_name":"WyriHaximusNet/docker-php","owner":"WyriHaximusNet","description":"Opinionated PHP Docker images","archived":false,"fork":false,"pushed_at":"2024-08-08T14:51:09.000Z","size":443,"stargazers_count":39,"open_issues_count":23,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-08T17:19:33.769Z","etag":null,"topics":["docker","hacktoberfest","parallel","php","php7","php8","reactphp","uv"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/wyrihaximusnet/php","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WyriHaximusNet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"WyriHaximus"}},"created_at":"2019-03-23T18:58:29.000Z","updated_at":"2024-08-08T14:51:11.000Z","dependencies_parsed_at":"2023-02-10T12:16:12.985Z","dependency_job_id":"88dcdbd1-33ba-4f84-a0fe-66ef48eed59f","html_url":"https://github.com/WyriHaximusNet/docker-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximusNet%2Fdocker-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximusNet%2Fdocker-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximusNet%2Fdocker-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyriHaximusNet%2Fdocker-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WyriHaximusNet","download_url":"https://codeload.github.com/WyriHaximusNet/docker-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243554064,"owners_count":20309860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docker","hacktoberfest","parallel","php","php7","php8","reactphp","uv"],"created_at":"2024-07-30T19:01:52.027Z","updated_at":"2025-03-14T09:31:52.670Z","avatar_url":"https://github.com/WyriHaximusNet.png","language":"PHP","funding_links":["https://github.com/sponsors/WyriHaximus"],"categories":["PHP","Shell"],"sub_categories":[],"readme":"# Opinionated ReactPHP optimised PHP Docker images\n\n[![Github Actions](https://github.com/WyriHaximusNet/docker-php/workflows/Continuous%20Integration/badge.svg?event=push)](https://github.com/wyrihaximusnet/docker-php/actions)\n[![Docker hub](https://img.shields.io/badge/Docker%20Hub-00a5c9.svg?logo=docker\u0026style=flat\u0026color=00a5c9\u0026labelColor=00a5c9\u0026logoColor=white)](https://hub.docker.com/r/wyrihaximusnet/php/)\n[![Docker hub](https://img.shields.io/docker/pulls/wyrihaximusnet/php.svg?color=00a5c9\u0026labelColor=03566a)](https://hub.docker.com/r/wyrihaximusnet/php/)\n[![Docker hub](https://img.shields.io/docker/image-size/wyrihaximusnet/php/8.4-zts-alpine-slim)](https://hub.docker.com/r/wyrihaximusnet/php/)\n\n# Images\n\nThis repo builds two different images, plus a `-dev` image for each containing [`composer`](https://getcomposer.org/), \nbash, git, ssh, strace, gdb, and make, and a `-root` image for all `*(-dev)` images where the default user is root. All the images \nare based on [`Alpine Linux`](https://alpinelinux.org/) and [`Debian Linux`](https://www.debian.org/). All images come with \nextensions used to increase the performance of [`ReactPHP`](https://reactphp.org/) (such as event loop extensions). Such extensions \nare highlighted **build** in the extensions list below. All the `Alpine Linux` images are scanned for vulnerabilities, and not pushed \nif any are found. The `Debian Linux` containers easily a few hundred so those aren't scanned. (There is no use in doing so.)\n\n## Images News\n\nSometimes big changes happen to images, to stay informed please subscribe to this thread: https://github.com/WyriHaximusNet/docker-php/issues/46\n\n### CVE Matrix\n\nCurrently Alpine and Debian images are treated differently, this matrix defines the differences between Alpine and Debian images:\n\n| Base Image | Description                                                      |\n|------------|------------------------------------------------------------------|\n| Alpine     | Don't push when CVE's are found when building                    |\n| Debian     | Not scanned for CVE's due to the ton of low CVE's found in there |\n\n## The available tags\n\nThe docker registry prefix is `wyrihaximusnet/php`, thus `wyrihaximusnet/php:OUR-TAGS`\n\nIn order to provide upgrade path we intend to keep one or more versions of PHP.\n\n[Currently Available tags on Docker hub](https://hub.docker.com/r/wyrihaximusnet/php/tags/)\n\nThe tag naming strategy consists of (Read as a regex):\n\n- PHP: `(phpMajor).(phpMinor)-(nts|zts)-(alpine((alpineMajor).(alpineMinor))|bullseye|buster|strech)(-slim)(-dev)(-root)?`\n  - Example: `8.2-zts-alpine-slim`, `8.4-nts-alpine3.13-dev`, `8.1-zts-buster-slim`\n\n## Example usage\n\nThe following example has two build staging, the first for leading in any required dependencies, and the second the \nactual image we'd want to use. In the second stage we copy the dependencies in without needing composer in the \nproduction image. We create the image with the following command:\n\n```bash\ndocker build . -t IMAGE_NAME:TAG --target=runtime\n```\n\n```dockerfile\nFROM ghcr.io/wyrihaximusnet/php:8.4-zts-alpine-slim-dev AS install-dependencies\n\nWORKDIR /opt/app\n\nCOPY ./composer.lock /opt/app/composer.lock\nCOPY ./composer.json /opt/app/composer.json\nCOPY ./src/ /opt/app/src/\nRUN composer install --ansi --no-interaction --prefer-dist --no-dev -o\n\nFROM ghcr.io/wyrihaximusnet/php:8.4-zts-alpine-slim AS runtime\n\nWORKDIR /opt/app\n\nCOPY ./composer.lock /opt/app/composer.lock\nCOPY ./composer.json /opt/app/composer.json\nCOPY --from=install-dependencies /opt/app/vendor/ /opt/app/vendor/\nCOPY ./src/ /opt/app/src/\nCOPY ./app.php /opt/app/app.php\n\nENTRYPOINT [\"php\", \"/opt/app/app.php\"]\n```\n\n### NTS\n\nNTS, or non-thread safe is the PHP version most people use. This image comes with the following extensions:\n\n| Extension | Description                              |\n|-----------|------------------------------------------|\n| ext-eio   | Provides interface to the libeio library |\n| ext-pcntl | PCNTL OS signals                         |\n| ext-uv    | LibUV event loop                         |\n| ext-event | Libevent event loop                      |\n\n### ZTS\n\nZTS, or zend thread safe is the PHP version that is safe to be used and required my threading extensions such as \npthreads or parallel. This image comes with the following extensions:\n\n| Extension    | Description                                                |\n|--------------|------------------------------------------------------------|\n| ext-eio      | Provides interface to the libeio library                   |\n| ext-parallel | A succinct parallel concurrency API for PHP7 using threads |\n| ext-pcntl    | PCNTL OS signals                                           |\n| ext-uv       | LibUV event loop                                           |\n\nBoth versions come with the following list of non-non-blocking related (core-) extensions:\n\n* bcmath\n* Core\n* ctype\n* curl\n* date\n* dom\n* fileinfo\n* filter\n* ftp\n* gd\n* gmp\n* hash\n* iconv\n* json\n* libxml\n* mbstring\n* mysqlnd\n* openssl\n* pcre\n* PDO\n* pdo_pgsql\n* pdo_sqlite\n* pgsql\n* Phar\n* posix\n* random\n* readline\n* Reflection\n* session\n* SimpleXML\n* sodium\n* SPL\n* sqlite3\n* standard\n* tokenizer\n* vips\n* xml\n* xmlreader\n* xmlwriter\n* zip\n* zlib\n\n# Slim images\n\nSlim images include all the above extensions except the following, as those notoriously require heavy dependencies:\n\n* gd\n* vips\n\n# Credits\n\nThis project is based on [Usabilla](https://usabilla.com/)'s [PHP Docker Template](https://github.com/usabilla/php-docker-template).\nLots of the documentation on that repository also applies here, with the big difference that this project only \nsupplies CLI images.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWyriHaximusNet%2Fdocker-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWyriHaximusNet%2Fdocker-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWyriHaximusNet%2Fdocker-php/lists"}