mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-10 11:01:14 +00:00
22
.github/workflows/action.yml
vendored
22
.github/workflows/action.yml
vendored
@@ -12,7 +12,29 @@ name: build
|
||||
on:
|
||||
# Push or pull_request will be determined in jobs.configure.enabled
|
||||
push:
|
||||
paths:
|
||||
- '.ansible/**'
|
||||
- '.github/workflows/action.yml'
|
||||
- '.github/workflows/params.yml'
|
||||
- 'Dockerfiles/**'
|
||||
- 'php_modules/**'
|
||||
- 'php_tools/**'
|
||||
- 'tests/**'
|
||||
- 'Makefile'
|
||||
- '!**.md'
|
||||
- '!.ansible/ansible.cfg'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.ansible/**'
|
||||
- '.github/workflows/action.yml'
|
||||
- '.github/workflows/params.yml'
|
||||
- 'Dockerfiles/**'
|
||||
- 'php_modules/**'
|
||||
- 'php_tools/**'
|
||||
- 'tests/**'
|
||||
- 'Makefile'
|
||||
- '!**.md'
|
||||
- '!.ansible/ansible.cfg'
|
||||
# Dispatch: allows for manual trigger via GH UI
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
## Unreleased
|
||||
|
||||
|
||||
## Release 0.146
|
||||
|
||||
This release adds lots of documentation about recently added features.
|
||||
|
||||
### Added
|
||||
- Documentation
|
||||
|
||||
|
||||
## Release 0.145
|
||||
|
||||
This is a massive restructuring release, which adds another layer on top of Ansible to easily manage/edit/add PHP tools and to configure their respective order of building and installing.
|
||||
|
||||
200
README.md
200
README.md
@@ -9,9 +9,11 @@
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
|
||||
| Upstream Project |
|
||||
|------------------|
|
||||
| <a title="Devilbox" href="https://github.com/cytopia/devilbox" ><img title="Devilbox" height="82px" src="https://raw.githubusercontent.com/devilbox/artwork/master/submissions_banner/cytopia/01/png/banner_256_trans.png" /></a> |
|
||||
| PHP-FPM | Reference Implementation |
|
||||
|:----------------:|:------------------------:|
|
||||
| <a title="Docker PHP-FPM" href="https://github.com/devilbox/docker-php-fpm" ><img height="82px" src="https://raw.githubusercontent.com/devilbox/artwork/master/submissions_banner/cytopia/02/png/banner_256_trans.png" /></a> | <a title="Devilbox" href="https://github.com/cytopia/devilbox" ><img height="82px" src="https://raw.githubusercontent.com/devilbox/artwork/master/submissions_banner/cytopia/01/png/banner_256_trans.png" /></a> |
|
||||
| Streamlined [PHP-FPM](https://github.com/devilbox/docker-php-fpm) images | The [Devilbox](https://github.com/cytopia/devilbox) |
|
||||
|
||||
|
||||
[](https://hub.docker.com/r/devilbox/php-fpm)
|
||||
|
||||
@@ -26,6 +28,7 @@ versions and packed with different types of integrated PHP modules. It also solv
|
||||
This repository also allows you to quickly generate and **build your own custom PHP-FPM Docker image** with whatever PHP extension your desire for whatever PHP version you want and for any platform you're on (`amd64` or `arm64`). Jump to **[#Build your own image](#build-your-own-image)**.
|
||||
|
||||
|
||||
|
||||
<h2><img id="docker-tags" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Docker Tags</h2>
|
||||
|
||||
* [`5.2-base`](Dockerfiles/base/Dockerfile-5.2), [`5.3-base`](Dockerfiles/base/Dockerfile-5.3), [`5.4-base`](Dockerfiles/base/Dockerfile-5.4), [`5.5-base`](Dockerfiles/base/Dockerfile-5.5), [`5.6-base`](Dockerfiles/base/Dockerfile-5.6), [`7.0-base`](Dockerfiles/base/Dockerfile-7.0), [`7.1-base`](Dockerfiles/base/Dockerfile-7.1), [`7.2-base`](Dockerfiles/base/Dockerfile-7.2), [`7.3-base`](Dockerfiles/base/Dockerfile-7.3), [`7.4-base`](Dockerfiles/base/Dockerfile-7.4), [`8.0-base`](Dockerfiles/base/Dockerfile-8.0), [`8.1-base`](Dockerfiles/base/Dockerfile-8.1), [`8.2-base`](Dockerfiles/base/Dockerfile-8.2)
|
||||
@@ -38,6 +41,7 @@ This repository also allows you to quickly generate and **build your own custom
|
||||
:information_source: For details see **[Documentation: Supported Architectures](doc/supported-architectures.md)**
|
||||
|
||||
|
||||
|
||||
<h2><img id="docker-tags" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> PHP Versions</h2>
|
||||
|
||||
The following PHP versions are provided by this repository.
|
||||
@@ -52,6 +56,7 @@ The following PHP versions are provided by this repository.
|
||||
:information_source: For details see **[Documentation: Base Images](doc/base-images.md)**
|
||||
|
||||
|
||||
|
||||
<h2><img id="php-fpm-flavours" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Flavours</h2>
|
||||
|
||||
The provided Docker images heavily rely on inheritance to guarantee smallest possible image size. Each of them provide a working PHP-FPM server and you must decide what version works best for you. Look at the sketch below to get an overview about the two provided flavours and each of their different types.
|
||||
@@ -86,6 +91,7 @@ The provided Docker images heavily rely on inheritance to guarantee smallest pos
|
||||
:information_source: For details see **[Documentation: Base Images](doc/base-images.md)**
|
||||
|
||||
|
||||
|
||||
<h2><img id="php-extensions" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Available PHP extensions</h2>
|
||||
|
||||
> Click below listed extensions for details:
|
||||
@@ -208,72 +214,68 @@ The provided Docker images heavily rely on inheritance to guarantee smallest pos
|
||||
|
||||
The provided Docker images offer environment variables to alter their startup behaviour.
|
||||
|
||||
:information_source: For details see **[Documentation: Flavours](doc/flavours.md)**<br/>
|
||||
:information_source: For details see **[Documentation: Environment Variables](doc/docker-env-variables.md)**<br/>
|
||||
:information_source: For details see **[Documentation: Environment Variables](doc/docker-env-variables.md)** or click on the variable name directly.
|
||||
|
||||
#### Flavour: base
|
||||
| Variable | Short description |
|
||||
|-------------------------------------------------|---------------------------------------------------------------|
|
||||
| [`DEBUG_ENTRYPOINT`][lnk_env_debug] | Control docker log verbosity |
|
||||
| [`NEW_UID`][lnk_env_uid] | Syncronize user-id file system permissions |
|
||||
| [`NEW_GID`][lnk_env_gid] | Syncronize group-id file system permissions |
|
||||
| [`TIMEZONE`][lnk_env_timezone] | Set timezone |
|
||||
| [`DOCKER_LOGS`][lnk_env_logs] | Make PHP log to file or docker logs |
|
||||
| [`ENABLE_MODULES`][lnk_env_enable_mods] | Enable specific PHP extensions |
|
||||
| [`DISABLE_MODULES`][lnk_env_disable_mods] | Disable specific PHP extensions |
|
||||
| [`ENABLE_MAIL`][lnk_env_enable_mail] | Control email-catch all (to not accidentally send out emails) |
|
||||
| [`FORWARD_PORTS_TO_LOCALHOST`][lnk_env_forward] | Make remote ports available locally inside the container |
|
||||
| [`MYSQL_BACKUP_USER`][lnk_env_backup_user] | Set MySQL username (for backups) |
|
||||
| [`MYSQL_BACKUP_PASS`][lnk_env_backup_pass] | Set MySQL password (for backups) |
|
||||
| [`MYSQL_BACKUP_HOST`][lnk_env_backup_host] | Set MySQL hostname (for backups) |
|
||||
|
||||
`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID`
|
||||
|
||||
#### Flavour: mods
|
||||
|
||||
`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID`
|
||||
|
||||
#### Flavour: prod
|
||||
|
||||
`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID`, `TIMEZONE`, `DOCKER_LOGS`, `ENABLE_MODULES`, `DISABLE_MODULES`, `ENABLE_MAIL`, `FORWARD_PORTS_TO_LOCALHOST`
|
||||
|
||||
#### Flavour: slim
|
||||
|
||||
`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID`, `TIMEZONE`, `DOCKER_LOGS`, `ENABLE_MODULES`, `DISABLE_MODULES`, `ENABLE_MAIL`, `FORWARD_PORTS_TO_LOCALHOST`,` MYSQL_BACKUP_USER`, `MYSQL_BACKUP_PASS`, `MYSQL_BACKUP_HOST`
|
||||
|
||||
#### Flavour: work
|
||||
|
||||
`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID`, `TIMEZONE`, `DOCKER_LOGS`, `ENABLE_MODULES`, `DISABLE_MODULES`, `ENABLE_MAIL`, `FORWARD_PORTS_TO_LOCALHOST`,` MYSQL_BACKUP_USER`, `MYSQL_BACKUP_PASS`, `MYSQL_BACKUP_HOST`
|
||||
[lnk_env_debug]: doc/docker-env-variables.md#-debug_entrypoint
|
||||
[lnk_env_uid]: doc/docker-env-variables.md#-new_uid
|
||||
[lnk_env_gid]: doc/docker-env-variables.md#-new_gid
|
||||
[lnk_env_timezone]: doc/docker-env-variables.md#-timezone
|
||||
[lnk_env_logs]: doc/docker-env-variables.md#-docker_logs
|
||||
[lnk_env_enable_mods]: doc/docker-env-variables.md#-enable_modules
|
||||
[lnk_env_disable_mods]: doc/docker-env-variables.md#-disable_modules
|
||||
[lnk_env_enable_mail]: doc/docker-env-variables.md#-enable_mail
|
||||
[lnk_env_forward]: doc/docker-env-variables.md#-forward_ports_to_localhost
|
||||
[lnk_env_backup_user]: doc/docker-env-variables.md#-mysql_backup_user
|
||||
[lnk_env_backup_pass]: doc/docker-env-variables.md#-mysql_backup_pass
|
||||
[lnk_env_backup_host]: doc/docker-env-variables.md#-mysql_backup_host
|
||||
|
||||
|
||||
|
||||
<h2><img id="php-fpm-options" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Volumes</h2>
|
||||
|
||||
The provided Docker images offer different volumes to be mounted
|
||||
The provided Docker images offer different volumes to be mounted.
|
||||
|
||||
:information_source: For details see **[Documentation: Flavours](doc/flavours.md)**<br/>
|
||||
:information_source: For details see **[Documentation: Volumes](doc/docker-volumes.md)**<br/>
|
||||
:information_source: For details see **[Documentation: Volumes](doc/docker-volumes.md)** or click on the volume name directly.
|
||||
|
||||
#### Flavour: base
|
||||
| Volume | Short description |
|
||||
|----------------------------------------------------|---------------------------------------|
|
||||
| [`/etc/php-custom.d/`][lnk_vol_php_custom] | Add custom PHP `*.ini` files |
|
||||
| [`/etc/php-fpm-custom.d/`][lnk_vol_php_fpm_custom] | Add custom PHP-FPM `*.conf` files |
|
||||
| [`/startup.1.d/`][lnk_vol_startup1] | Add custom startup `*.sh` files |
|
||||
| [`/startup.2.d/`][lnk_vol_startup2] | Add custom startup `*.sh` files |
|
||||
| [`/var/log/php/`][lnk_vol_log_php] | Find PHP log files |
|
||||
| [`/var/mail/`][lnk_vol_mail] | Find sent emails |
|
||||
| [`/etc/supervisor/custom.d/`][lnk_vol_supervisor] | Add custom supervisord `*.conf` files |
|
||||
| [`/etc/bashrc-devilbox.d/`][lnk_vol_bashrc] | Add custom bashrc files |
|
||||
| [`/shared/backups/`][lnk_vol_backups] | Find MySQL backups |
|
||||
| [`/ca/`][lnk_vol_ca] | Add custom Certificate Authority |
|
||||
|
||||
* None
|
||||
[lnk_vol_php_custom]: doc/docker-volumes.md#-etcphp-customd
|
||||
[lnk_vol_php_fpm_custom]: doc/docker-volumes.md#-etcphp-fpm-customd
|
||||
[lnk_vol_startup1]: doc/docker-volumes.md#-startup1d
|
||||
[lnk_vol_startup2]: doc/docker-volumes.md#-startup2d
|
||||
[lnk_vol_log_php]: doc/docker-volumes.md#-varlogphp
|
||||
[lnk_vol_mail]: doc/docker-volumes.md#-varmail
|
||||
[lnk_vol_supervisor]: doc/docker-volumes.md#-etcsupervisorcustomd
|
||||
[lnk_vol_bashrc]: doc/docker-volumes.md#-etcbashrc-devilboxd
|
||||
[lnk_vol_backups]: doc/docker-volumes.md#-sharedbackups
|
||||
[lnk_vol_ca]: doc/docker-volumes.md#-ca
|
||||
|
||||
#### Flavour: mods
|
||||
|
||||
* None
|
||||
|
||||
#### Flavour: prod
|
||||
|
||||
* **[`/etc/php-custom.d`]()**, **[`/etc/php-fpm-custom.d`]()** - *custom PHP/PHP-FPM config files*
|
||||
* **[`/startup.1.d`]()**, **[`/startup.2.d`]()** - *custom startup scripts*
|
||||
* **[`/var/log/php`]()**, **[`/var/mail`]()** - *logs and mail data*
|
||||
* **[`/etc/supervisor/custom.d`]()** - *custom supervisord config files*
|
||||
|
||||
#### Flavour: slim
|
||||
|
||||
* **[`/etc/php-custom.d`]()**, **[`/etc/php-fpm-custom.d`]()** - *custom PHP/PHP-FPM config files*
|
||||
* **[`/startup.1.d`]()**, **[`/startup.2.d`]()** - *custom startup scripts*
|
||||
* **[`/var/log/php`]()**, **[`/var/mail`]()** - *logs and mail data*
|
||||
* **[`/etc/supervisor/custom.d`]()** - *custom supervisord config files*
|
||||
* **[`/etc/bashrc-devilbox.d`]()** - *custom bashrc config files*
|
||||
* **[`/shared/backups`]()** - *backup data*
|
||||
* **[`/ca`]()** - *trusted Certificate Authorities*
|
||||
|
||||
#### Flavour: work
|
||||
|
||||
* **[`/etc/php-custom.d`]()**, **[`/etc/php-fpm-custom.d`]()** - *custom PHP/PHP-FPM config files*
|
||||
* **[`/startup.1.d`]()**, **[`/startup.2.d`]()** - *custom startup scripts*
|
||||
* **[`/var/log/php`]()**, **[`/var/mail`]()** - *logs and mail data*
|
||||
* **[`/etc/supervisor/custom.d`]()** - *custom supervisord config files*
|
||||
* **[`/etc/bashrc-devilbox.d`]()** - *custom bashrc config files*
|
||||
* **[`/shared/backups`]()** - *backup data*
|
||||
* **[`/ca`]()** - *trusted Certificate Authorities*
|
||||
|
||||
|
||||
<h2><img id="php-fpm-options" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Ports</h2>
|
||||
@@ -309,7 +311,7 @@ Each PHP version is using the same sane default php.ini values, making it pain-f
|
||||
| base | [php.ini](Dockerfiles/base/data/php-ini.d/) and [php-fpm.conf](Dockerfiles/base/data/php-fpm.conf/) |
|
||||
| mods | inherits from base |
|
||||
| prod | inherits from base |
|
||||
| slim | [php.ini](Dockerfiles/work/data/php-ini.d/) and [php-fpm.conf](Dockerfiles/work/data/php-fpm.conf/) |
|
||||
| slim | [php.ini](Dockerfiles/slim/data/php-ini.d/) and [php-fpm.conf](Dockerfiles/slim/data/php-fpm.conf/) |
|
||||
| work | inherits from slim |
|
||||
|
||||
|
||||
@@ -461,6 +463,7 @@ If you want a fully functional Docker Compose setup, which allows to switch PHP
|
||||
Docker images are built and tested every night by **[GitHub Actions](https://github.com/devilbox/docker-php-fpm/actions?workflow=nightly)** and pushed to **[Docker hub](https://hub.docker.com/r/devilbox/php-fpm/)** on success. This is all done automatically to ensure that sources as well as base images are always fresh and in case of security updates always have the latest patches.
|
||||
|
||||
|
||||
|
||||
<h2><img id="build-your-own-image" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Build your own image</h2>
|
||||
|
||||
You are not interested in the provided Docker images and want to (ab)use this repository purely to generate your own custom images?
|
||||
@@ -479,14 +482,17 @@ make build STAGE=mods VERSION=8.1 ARCH=linux/arm64
|
||||
:information_source: For details see **[Abuser Documentation: Build your own image](doc/abuser/README.md)**
|
||||
|
||||
|
||||
|
||||
<h2><img id="contributing" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Contributing</h2>
|
||||
|
||||
Contributors are welcome. Feel free to star and clone this repository and submit issues and pull-requests. Add examples and show what you have created with the provided images. If you see any errors or ways to improve this repository in any way, please do so.
|
||||
|
||||
:information_source: For details see **[Contributor Documentation: PHP Module definitions](php_modules/README.md)**
|
||||
:information_source: For details see **[Contributor Documentation: PHP Module definitions](php_modules/README.md)**<br/>
|
||||
:information_source: For details see **[Contributor Documentation: PHP Tools definitions](php_tools/README.md)**
|
||||
|
||||
|
||||
<h2><img id="contributing" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Related Project</h2>
|
||||
|
||||
<h2><img id="related-projects" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Related Project</h2>
|
||||
|
||||
If you want to add custom modules, tools or apply any other changes, but don't think it fits in here, you can do so over at the **[PHP-FPM Community Images](https://github.com/devilbox/docker-php-fpm-community)**.
|
||||
|
||||
@@ -505,6 +511,46 @@ See the reference implementation below:
|
||||
<!-- PROJECTS_END -->
|
||||
|
||||
|
||||
|
||||
<h2><img id="sister-projects" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Sister Projects</h2>
|
||||
|
||||
Show some love for the following sister projects.
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>🖤 Project</th>
|
||||
<th>🐱 GitHub</th>
|
||||
<th>🐋 DockerHub</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a title="Devilbox" href="https://github.com/cytopia/devilbox" ><img width="256px" src="https://raw.githubusercontent.com/devilbox/artwork/master/submissions_banner/cytopia/01/png/banner_256_trans.png" /></a></td>
|
||||
<td><a href="https://github.com/cytopia/devilbox"><code>Devilbox</code></a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a title="Docker MySQL" href="https://github.com/devilbox/docker-mysql" ><img width="256px" src="https://raw.githubusercontent.com/devilbox/artwork/master/submissions_banner/cytopia/04/png/banner_256_trans.png" /></a></td>
|
||||
<td><a href="https://github.com/devilbox/docker-mysql"><code>docker-mysql</code></a></td>
|
||||
<td><a href="https://hub.docker.com/r/devilbox/mysql"><code>devilbox/mysql</code></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img width="256px" src="https://raw.githubusercontent.com/devilbox/artwork/master/submissions_banner/cytopia/05/png/banner_256_trans.png" /></td>
|
||||
<td>
|
||||
<a href="https://github.com/devilbox/docker-apache-2.2"><code>docker-apache-2.2</code></a><br/>
|
||||
<a href="https://github.com/devilbox/docker-apache-2.4"><code>docker-apache-2.4</code></a><br/>
|
||||
<a href="https://github.com/devilbox/docker-nginx-stable"><code>docker-nginx-stable</code></a><br/>
|
||||
<a href="https://github.com/devilbox/docker-nginx-mainline"><code>docker-nginx-mainline</code></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://hub.docker.com/r/devilbox/apache-2.2"><code>devilbox/apache-2.2</code></a><br/>
|
||||
<a href="https://hub.docker.com/r/devilbox/apache-2.4"><code>devilbox/apache-2.4</code></a><br/>
|
||||
<a href="https://hub.docker.com/r/devilbox/nginx-stable"><code>devilbox/nginx-stable</code></a><br/>
|
||||
<a href="https://hub.docker.com/r/devilbox/nginx-mainline"><code>devilbox/nginx-mainline</code></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<h2><img id="community" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Community</h2>
|
||||
|
||||
In case you seek help, go and visit the community pages.
|
||||
@@ -512,9 +558,9 @@ In case you seek help, go and visit the community pages.
|
||||
<table width="100%" style="width:100%; display:table;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="33%" style="width:33%;"><h3><a target="_blank" href="https://devilbox.readthedocs.io">Documentation</a></h3></th>
|
||||
<th width="33%" style="width:33%;"><h3><a target="_blank" href="https://gitter.im/devilbox/Lobby">Chat</a></h3></th>
|
||||
<th width="33%" style="width:33%;"><h3><a target="_blank" href="https://devilbox.discourse.group">Forum</a></h3></th>
|
||||
<th width="33%" style="width:33%;"><h3><a target="_blank" href="https://devilbox.readthedocs.io">📘 Documentation</a></h3></th>
|
||||
<th width="33%" style="width:33%;"><h3><a target="_blank" href="https://gitter.im/devilbox/Lobby">🗪 Chat</a></h3></th>
|
||||
<th width="33%" style="width:33%;"><h3><a target="_blank" href="https://devilbox.discourse.group">🗫 Forum</a></h3></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="vertical-align: middle; text-align: center;">
|
||||
@@ -544,9 +590,9 @@ In case you seek help, go and visit the community pages.
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<h2><img id="credits" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Credits</h2>
|
||||
|
||||
- **[@cytopia](https://github.com/cytopia)**
|
||||
- **[@mrLexx](https://github.com/mrLexx)**
|
||||
- **[@fibis](https://github.com/fibis)**
|
||||
- **[@llaville](https://github.com/llaville)**
|
||||
@@ -555,6 +601,30 @@ In case you seek help, go and visit the community pages.
|
||||
- **[@Tuurlijk](https://github.com/Tuurlijk)**
|
||||
|
||||
|
||||
|
||||
<h2><img id="maintainer" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Maintainer</h2>
|
||||
|
||||
**[@cytopia](https://github.com/cytopia)**
|
||||
|
||||
I try to keep up with literally **over 100 projects** besides a full-time job.
|
||||
If my work is making your life easier, consider contributing. 🖤
|
||||
|
||||
* [GitHub Sponsorship](https://github.com/sponsors/cytopia)
|
||||
* [Patreon](https://www.patreon.com/devilbox)
|
||||
* [Open Collective](https://opencollective.com/devilbox)
|
||||
|
||||
**Findme:**
|
||||
**🐱** [cytopia](https://github.com/cytopia) / [devilbox](https://github.com/devilbox) |
|
||||
**🐋** [cytopia](https://hub.docker.com/r/cytopia/) / [devilbox](https://hub.docker.com/r/devilbox/) |
|
||||
**🐦** [everythingcli](https://twitter.com/everythingcli) / [devilbox](https://twitter.com/devilbox) |
|
||||
**📖** [everythingcli.org](http://www.everythingcli.org/)
|
||||
|
||||
**Contrib:** PyPI: [cytopia](https://pypi.org/user/cytopia/) **·**
|
||||
Terraform: [cytopia](https://registry.terraform.io/namespaces/cytopia) **·**
|
||||
Ansible: [cytopia](https://galaxy.ansible.com/cytopia)
|
||||
|
||||
|
||||
|
||||
<h2><img id="license" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> License</h2>
|
||||
|
||||
**[MIT License](LICENSE.md)**
|
||||
|
||||
@@ -38,7 +38,11 @@ DEFAULT_TOOLS = [
|
||||
{"name": "**composer**", "dir": "https://getcomposer.org/", "exclude": []},
|
||||
{"name": "**corepack**", "dir": "https://nodejs.org/api/corepack.html", "exclude": []},
|
||||
{"name": "**nvm**", "dir": "https://github.com/nvm-sh/nvm", "exclude": []},
|
||||
{"name": "**npm**", "dir": "https://nodejs.org/en/knowledge/getting-started/npm/what-is-npm/", "exclude": []},
|
||||
{
|
||||
"name": "**npm**",
|
||||
"dir": "https://nodejs.org/en/knowledge/getting-started/npm/what-is-npm/",
|
||||
"exclude": [],
|
||||
},
|
||||
{"name": "**node**", "dir": "https://nodejs.org/en/", "exclude": []},
|
||||
{"name": "**yarn**", "dir": "https://yarnpkg.com/cli/install", "exclude": []},
|
||||
{"name": "**pip**", "dir": "https://pypi.org/", "exclude": []},
|
||||
|
||||
@@ -64,9 +64,9 @@ def get_module_options(module_dirname: str) -> Dict[str, Any]:
|
||||
return load_yaml(os.path.join(PHP_MODULE_PATH, module_dirname, "options.yml"))
|
||||
|
||||
|
||||
def get_module_build(module_dirname: str) -> Dict[str, Any]:
|
||||
"""Returns yaml dict build configuration of a PHP module given by its absolute file path."""
|
||||
return load_yaml(os.path.join(PHP_MODULE_PATH, module_dirname, "build.yml"))
|
||||
def get_module_install(module_dirname: str) -> Dict[str, Any]:
|
||||
"""Returns yaml dict install configuration of a PHP module given by its absolute file path."""
|
||||
return load_yaml(os.path.join(PHP_MODULE_PATH, module_dirname, "install.yml"))
|
||||
|
||||
|
||||
def get_module_test(module_dirname: str) -> Dict[str, Any]:
|
||||
@@ -196,7 +196,7 @@ def write_group_vars(modules: List[str]) -> None:
|
||||
opts = get_module_options(module)
|
||||
fp.write(" " + module + ":\n")
|
||||
fp.write(" disabled: [" + ", ".join(str(x) for x in opts["exclude"]) + "]\n")
|
||||
fp.write(load_yaml_raw(os.path.join(PHP_MODULE_PATH, module, "build.yml"), 4))
|
||||
fp.write(load_yaml_raw(os.path.join(PHP_MODULE_PATH, module, "install.yml"), 4))
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -64,8 +64,8 @@ def get_tool_options(tool_dirname: str) -> Dict[str, Any]:
|
||||
return load_yaml(os.path.join(PHP_TOOL_PATH, tool_dirname, "options.yml"))
|
||||
|
||||
|
||||
def get_tool_build(tool_dirname: str) -> Dict[str, Any]:
|
||||
"""Returns yaml dict build configuration of a PHP tool given by its absolute file path."""
|
||||
def get_tool_install(tool_dirname: str) -> Dict[str, Any]:
|
||||
"""Returns yaml dict install configuration of a PHP tool given by its absolute file path."""
|
||||
return load_yaml(os.path.join(PHP_TOOL_PATH, tool_dirname, "install.yml"))
|
||||
|
||||
|
||||
|
||||
@@ -17,9 +17,131 @@ Tools |
|
||||
:information_source: For details on how to generate modules see **[Abuser Documentation: Build your own image](../doc/abuser/README.md)**<br/>
|
||||
|
||||
|
||||
### PHP Tools (`slim`)
|
||||
### PHP Tools ([`prod`](flavours.md#prod))
|
||||
|
||||
The following PHP cli tools are available on the `slim` flavour:
|
||||
The following PHP cli tools are available on the [`prod`](flavours.md#prod) flavour:
|
||||
|
||||
> :information_source: Click on any tool name to find out what they are
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Tool</th>
|
||||
<th>PHP 5.2</th>
|
||||
<th>PHP 5.3</th>
|
||||
<th>PHP 5.4</th>
|
||||
<th>PHP 5.5</th>
|
||||
<th>PHP 5.6</th>
|
||||
<th>PHP 7.0</th>
|
||||
<th>PHP 7.1</th>
|
||||
<th>PHP 7.2</th>
|
||||
<th>PHP 7.3</th>
|
||||
<th>PHP 7.4</th>
|
||||
<th>PHP 8.0</th>
|
||||
<th>PHP 8.1</th>
|
||||
<th>PHP 8.2</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="https://linux.die.net/man/8/cron">Cron</a></td>
|
||||
<td class="tool_prod_cron_5.2">✓</td>
|
||||
<td class="tool_prod_cron_5.3">✓</td>
|
||||
<td class="tool_prod_cron_5.4">✓</td>
|
||||
<td class="tool_prod_cron_5.5">✓</td>
|
||||
<td class="tool_prod_cron_5.6">✓</td>
|
||||
<td class="tool_prod_cron_7.0">✓</td>
|
||||
<td class="tool_prod_cron_7.1">✓</td>
|
||||
<td class="tool_prod_cron_7.2">✓</td>
|
||||
<td class="tool_prod_cron_7.3">✓</td>
|
||||
<td class="tool_prod_cron_7.4">✓</td>
|
||||
<td class="tool_prod_cron_8.0">✓</td>
|
||||
<td class="tool_prod_cron_8.1">✓</td>
|
||||
<td class="tool_prod_cron_8.2">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://www.postfix.org/">Postfix</a></td>
|
||||
<td class="tool_prod_postfix_5.2">✓</td>
|
||||
<td class="tool_prod_postfix_5.3">✓</td>
|
||||
<td class="tool_prod_postfix_5.4">✓</td>
|
||||
<td class="tool_prod_postfix_5.5">✓</td>
|
||||
<td class="tool_prod_postfix_5.6">✓</td>
|
||||
<td class="tool_prod_postfix_7.0">✓</td>
|
||||
<td class="tool_prod_postfix_7.1">✓</td>
|
||||
<td class="tool_prod_postfix_7.2">✓</td>
|
||||
<td class="tool_prod_postfix_7.3">✓</td>
|
||||
<td class="tool_prod_postfix_7.4">✓</td>
|
||||
<td class="tool_prod_postfix_8.0">✓</td>
|
||||
<td class="tool_prod_postfix_8.1">✓</td>
|
||||
<td class="tool_prod_postfix_8.2">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://www.postfix.org/pcre_table.5.html">Postfix PCRE</a></td>
|
||||
<td class="tool_prod_postfix_pcre_5.2">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_5.3">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_5.4">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_5.5">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_5.6">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_7.0">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_7.1">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_7.2">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_7.3">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_7.4">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_8.0">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_8.1">✓</td>
|
||||
<td class="tool_prod_postfix_pcre_8.2">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="https://www.rsyslog.com/">Rsyslog</a></td>
|
||||
<td class="tool_prod_rsyslog_5.2">✓</td>
|
||||
<td class="tool_prod_rsyslog_5.3">✓</td>
|
||||
<td class="tool_prod_rsyslog_5.4">✓</td>
|
||||
<td class="tool_prod_rsyslog_5.5">✓</td>
|
||||
<td class="tool_prod_rsyslog_5.6">✓</td>
|
||||
<td class="tool_prod_rsyslog_7.0">✓</td>
|
||||
<td class="tool_prod_rsyslog_7.1">✓</td>
|
||||
<td class="tool_prod_rsyslog_7.2">✓</td>
|
||||
<td class="tool_prod_rsyslog_7.3">✓</td>
|
||||
<td class="tool_prod_rsyslog_7.4">✓</td>
|
||||
<td class="tool_prod_rsyslog_8.0">✓</td>
|
||||
<td class="tool_prod_rsyslog_8.1">✓</td>
|
||||
<td class="tool_prod_rsyslog_8.2">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://www.dest-unreach.org/socat/">Socat</a></td>
|
||||
<td class="tool_prod_socat_5.2">✓</td>
|
||||
<td class="tool_prod_socat_5.3">✓</td>
|
||||
<td class="tool_prod_socat_5.4">✓</td>
|
||||
<td class="tool_prod_socat_5.5">✓</td>
|
||||
<td class="tool_prod_socat_5.6">✓</td>
|
||||
<td class="tool_prod_socat_7.0">✓</td>
|
||||
<td class="tool_prod_socat_7.1">✓</td>
|
||||
<td class="tool_prod_socat_7.2">✓</td>
|
||||
<td class="tool_prod_socat_7.3">✓</td>
|
||||
<td class="tool_prod_socat_7.4">✓</td>
|
||||
<td class="tool_prod_socat_8.0">✓</td>
|
||||
<td class="tool_prod_socat_8.1">✓</td>
|
||||
<td class="tool_prod_socat_8.2">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://supervisord.org/">Supervisor</a></td>
|
||||
<td class="tool_prod_supervisor_5.2">✓</td>
|
||||
<td class="tool_prod_supervisor_5.3">✓</td>
|
||||
<td class="tool_prod_supervisor_5.4">✓</td>
|
||||
<td class="tool_prod_supervisor_5.5">✓</td>
|
||||
<td class="tool_prod_supervisor_5.6">✓</td>
|
||||
<td class="tool_prod_supervisor_7.0">✓</td>
|
||||
<td class="tool_prod_supervisor_7.1">✓</td>
|
||||
<td class="tool_prod_supervisor_7.2">✓</td>
|
||||
<td class="tool_prod_supervisor_7.3">✓</td>
|
||||
<td class="tool_prod_supervisor_7.4">✓</td>
|
||||
<td class="tool_prod_supervisor_8.0">✓</td>
|
||||
<td class="tool_prod_supervisor_8.1">✓</td>
|
||||
<td class="tool_prod_supervisor_8.2">✓</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### PHP Tools ([`slim`](flavours.md#slim))
|
||||
|
||||
Additionally to all of the `prod` tools shown above, the following PHP cli tools are available on the [`slim`](flavours.md#slim) flavour:
|
||||
|
||||
> :information_source: Click on any tool name to find out what they are
|
||||
|
||||
@@ -237,10 +359,9 @@ The following PHP cli tools are available on the `slim` flavour:
|
||||
> :exclamation: **\[1\]** Not available on `arm64` Docker image.
|
||||
|
||||
|
||||
### PHP Tools ([`work`](flavours.md#work))
|
||||
|
||||
### PHP Tools (`work`)
|
||||
|
||||
Additionally to all of the `slim` tools shown above, the following PHP cli tools are available on the `work` flavour:
|
||||
Additionally to all of the `slim` tools shown above, the following PHP cli tools are available on the [`work`](flavours.md#work) flavour:
|
||||
|
||||
> :information_source: Click on any tool name to find out what they are
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Base Images
|
||||
|
||||
### Base Images
|
||||
|
||||
Have a look at the following Devilbox base images for which no official versions exist yet, but are required to serve as a foundation for this repository:
|
||||
Have a look at the following Devilbox base images for which no official versions exist yet (as of the time of writing), but are required to serve as a foundation for this repository:
|
||||
|
||||
* [PHP-FPM 5.2](https://github.com/devilbox/docker-php-fpm-5.2)
|
||||
* [PHP-FPM 5.3](https://github.com/devilbox/docker-php-fpm-5.3)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[PHP Mods: Overview](../../php_modules/README.md) |
|
||||
[PHP Mods: `options.yml`](PHP-EXT-options.yml.md) |
|
||||
PHP Mods: `build.yml` |
|
||||
[PHP Mods: `test.yml`](PHP-EXT-test.yml.md)
|
||||
PHP Mods: `install.yml`
|
||||
|
||||
---
|
||||
|
||||
@@ -9,7 +8,7 @@ PHP Mods: `build.yml` |
|
||||
|
||||
|
||||
|
||||
# Extension definition: `build.yml`
|
||||
# Extension definition: `install.yml`
|
||||
|
||||
|
||||
## Top level defines
|
||||
@@ -30,16 +29,21 @@ already_avail: "{{ php_all_versions }}"
|
||||
**Example:** Overwriting `git_ref` for a specific version
|
||||
```yaml
|
||||
already_avail: [5.2]
|
||||
|
||||
all:
|
||||
type: git
|
||||
git_url: https://github.com/phalcon/cphalcon
|
||||
git_ref: master
|
||||
|
||||
# PHP 8.1 is using a different git_ref
|
||||
8.1:
|
||||
type: git
|
||||
git_ref: v1.0.0
|
||||
|
||||
# PHP 8.0 is using a different git_ref dynamically with latest tag found
|
||||
# See the usage of supported shell code
|
||||
8.0:
|
||||
type: git
|
||||
git_ref: $( git tag | sort -V | tail -1 )
|
||||
```
|
||||
|
||||
@@ -54,7 +58,7 @@ The following keys can be added below: `all`, `8.2`, `8.1`, `8.0`, `7.4`, ...
|
||||
| `post` | No | Yes | Specify a shell command to be run after module installation. |
|
||||
| `build_dep` | No | No | Array Debian packages required to build the module (they won't be present in the final image - only used to built the module) If you don't need any, assign it an empty array: `build_dep: []`. |
|
||||
| `run_dep` | No | No | Array Debian packages required for the module run-time (they won't be present during the build stage - only in the final image). If you don't need any, assign it an empty array: `run_dep: []`. |
|
||||
| `type` | **Yes** | No | On of the following types to build the module: `builtin`, `pecl`, `git`, `custom`. |
|
||||
| `type` | **Yes** | No | On of the following types to build the module: `builtin`, `pecl`, `git` or `custom`. |
|
||||
|
||||
**Example:**
|
||||
```yaml
|
||||
@@ -66,6 +70,7 @@ all:
|
||||
rm -f /tmp/file.txt \
|
||||
build_dep: [libmcrypt-dev]
|
||||
run_dep: [libmcrypt4]
|
||||
|
||||
8.1:
|
||||
type: builtin
|
||||
build_dep: []
|
||||
@@ -83,9 +88,11 @@ all:
|
||||
```yaml
|
||||
all:
|
||||
type: builtin
|
||||
|
||||
8.1:
|
||||
type: builtin
|
||||
configure: --with-jpeg --with-png
|
||||
|
||||
8.0:
|
||||
type: builtin
|
||||
configure: --with-jpeg
|
||||
@@ -106,6 +113,7 @@ all:
|
||||
command: echo "/usr" | pecl install amqp
|
||||
build_dep: [librabbitmq-dev]
|
||||
run_dep: [librabbitmq4]
|
||||
|
||||
5.5:
|
||||
type: pecl
|
||||
version: 1.9.3
|
||||
@@ -125,16 +133,22 @@ all:
|
||||
**Example:**
|
||||
```yaml
|
||||
already_avail: [5.2]
|
||||
|
||||
# Default for all PHP versions if no overwrite exists
|
||||
all:
|
||||
type: git
|
||||
git_url: https://github.com/phalcon/cphalcon
|
||||
git_ref: master
|
||||
# PHP 8.1 is using a different git_ref
|
||||
|
||||
# PHP 8.1 is overwriting the git_ref
|
||||
8.1:
|
||||
type: git
|
||||
git_ref: v1.0.0
|
||||
|
||||
# PHP 8.0 is using a different git_ref dynamically with latest tag found
|
||||
# See the usage of supported shell code
|
||||
8.0:
|
||||
type: git
|
||||
git_ref: $( git tag | sort -V | tail -1 )
|
||||
```
|
||||
|
||||
@@ -166,12 +180,12 @@ all:
|
||||
|
||||
**Note:** All keys that support shell code can be written as a single line yaml definition or as a multi line yaml definition. Multi-line yaml definitions need a trailing `\` at the end of each line, including the last line.<br/>
|
||||
**Single-line:**
|
||||
```bash
|
||||
```yaml
|
||||
all:
|
||||
pre: VERSION="$( curl http://url | grep -Eo '[0-9.]+' )"
|
||||
```
|
||||
**Multi-line:**
|
||||
```bash
|
||||
```yaml
|
||||
all:
|
||||
pre: |
|
||||
VERSION="$( \
|
||||
@@ -184,7 +198,7 @@ all:
|
||||
|
||||
**Note:** All keys that support shell code also support to write multiple shell commands. If you use multiple shell commands, you need to separate them with `&&`.<br/>
|
||||
**Single-command:**
|
||||
```bash
|
||||
```yaml
|
||||
all:
|
||||
pre: |
|
||||
VERSION="$( \
|
||||
@@ -193,7 +207,7 @@ all:
|
||||
)" \
|
||||
```
|
||||
**Multi-command:**
|
||||
```bash
|
||||
```yaml
|
||||
all:
|
||||
pre: |
|
||||
URL="http://url" \
|
||||
@@ -1,7 +1,6 @@
|
||||
[PHP Mods: Overview](../../php_modules/README.md) |
|
||||
PHP Mods: `options.yml` |
|
||||
[PHP Mods: `build.yml`](PHP-EXT-build.yml.md) |
|
||||
[PHP Mods: `test.yml`](PHP-EXT-test.yml.md)
|
||||
[PHP Mods: `install.yml`](PHP-EXT-install.yml.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -19,7 +18,7 @@ These options are purely for the module generator to decide whether or not to bu
|
||||
* Required: Yes
|
||||
* Type: `str`
|
||||
|
||||
The lower-case name of the extension as it is shown by `php -m`.
|
||||
The lower-case name of the extension as it is shown by `php -m` (must match directory name).
|
||||
|
||||
|
||||
### `exclude`
|
||||
@@ -36,7 +35,7 @@ Example:
|
||||
exclude: [5.2, 5.3]
|
||||
```
|
||||
|
||||
**Note:** If this extension is already present, do not exclude it in here, but rather use `already_avail` in `build.yml`.
|
||||
**Note:** If this extension is already present, do not exclude it in here, but rather use `already_avail` in `install.yml`.
|
||||
|
||||
|
||||
### `depends_build`
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
[PHP Mods: Overview](../../php_modules/README.md) |
|
||||
[PHP Mods: `options.yml`](PHP-EXT-options.yml.md) |
|
||||
[PHP Mods: `build.yml`](PHP-EXT-build.yml.md) |
|
||||
PHP Mods: `test.yml`
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Contributor Documentation: PHP Modules</h2>
|
||||
|
||||
|
||||
|
||||
# Extension definition: `test.yml`
|
||||
|
||||
### Goal
|
||||
The goal of these tests will be to ensure that each compiled module works as expected:
|
||||
* Required system libraries are present
|
||||
* Module has been loaded in correct order
|
||||
* Module works properly
|
||||
|
||||
This will be accomplished by providing example PHP code, which makes calls to functions of the respective module. The tests will then check PHP error logs, stderr, unforseen exits and segfaults for potential errors.
|
||||
|
||||
Currently some basic tests already exist or a few modules **[here](../../tests/mods/modules)**.
|
||||
|
||||
|
||||
### Configuration
|
||||
|
||||
This is not yet implemented and thus no documentation exists.
|
||||
227
doc/contributor/PHP-TOOL-install.yml.md
Normal file
227
doc/contributor/PHP-TOOL-install.yml.md
Normal file
@@ -0,0 +1,227 @@
|
||||
[PHP Tools: Overview](../../php_tools/README.md) |
|
||||
[PHP Tools: `options.yml`](PHP-TOOL-options.yml.md) |
|
||||
PHP Tools: `install.yml`
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Contributor Documentation: PHP Tools</h2>
|
||||
|
||||
|
||||
|
||||
# Tool definition: `install.yml`
|
||||
|
||||
|
||||
## Top level defines
|
||||
|
||||
| Yaml key | Description |
|
||||
|-----------------|-------------|
|
||||
| `check` | A check command to test that the tool has been installed correctly. |
|
||||
| `all` | Is generic for all PHP versions and will be used whenever no specific version is defined. |
|
||||
| `7.2` | A version specific block for PHP 7.2. Its child keys will overwrite what has been defined in `all`. |
|
||||
**Example:**
|
||||
```yaml
|
||||
check: yq --version 2>&1 | grep -E '[0-9][.0-9]+' || (yq --version; false)
|
||||
|
||||
# Default for all PHP version if no overwrite exists
|
||||
all:
|
||||
type: pip
|
||||
version:
|
||||
build_dep: []
|
||||
run_dep: []
|
||||
pre:
|
||||
post:
|
||||
|
||||
|
||||
# PHP 5.2 is overwriting the version of yq to install
|
||||
5.2:
|
||||
type: pip
|
||||
version: 0.1.0
|
||||
```
|
||||
|
||||
|
||||
## Second level defines
|
||||
|
||||
The following keys can be added below: `all`, `8.2`, `8.1`, `8.0`, `7.4`, ...
|
||||
|
||||
| Yaml key | Required | Supports<br/>Shell code | Description |
|
||||
|-------------|----------|-------------------------|-------------|
|
||||
| `pre` | No | Yes | Specify a shell command to be run before module installation. |
|
||||
| `post` | No | Yes | Specify a shell command to be run after module installation. |
|
||||
| `build_dep` | No | No | Array Debian packages required to build the module (they won't be present in the final image - only used to built the module) If you don't need any, assign it an empty array: `build_dep: []`. |
|
||||
| `run_dep` | No | No | Array Debian packages required for the module run-time (they won't be present during the build stage - only in the final image). If you don't need any, assign it an empty array: `run_dep: []`. |
|
||||
| `type` | **Yes** | No | On of the following types to build the module: `apt`, `composer`, `npm`, `pip`, `rubygem` or `custom`. |
|
||||
|
||||
**Note:** When using `type: custom`, all data needs to be installed into `/usr/local/bin` as only this directory is copied into the next docker stage during multi-stage build.
|
||||
|
||||
|
||||
## Second level defines for `type: apt`
|
||||
|
||||
| Yaml key | Required | Supports<br/>Shell code | Description |
|
||||
|-------------|----------|-------------------------|-------------|
|
||||
| `package` | Yes | No | Specify the Debian apt package to install |
|
||||
|
||||
**Example:**
|
||||
```yaml
|
||||
all:
|
||||
type: apt
|
||||
package: netcat
|
||||
|
||||
5.3:
|
||||
type: apt
|
||||
package: netcat.traditional
|
||||
```
|
||||
|
||||
|
||||
## Second level defines for `type: composer`
|
||||
|
||||
| Yaml key | Required | Supports<br/>Shell code | Description |
|
||||
|-------------|----------|-------------------------|-------------|
|
||||
| `package` | Yes | No | Specify the Composer package name to install |
|
||||
| `composer` | Yes | No | Specify the composer version to use for installation: `1` or `2` |
|
||||
| `version` | No | Yes | Specify the Composer package version to install |
|
||||
| `binary` | No | Yes | Specify the composer relative binary path to symlink to `/usr/loca/bin/` |
|
||||
| `flags` | No | Yes | Add composer flags to `composer require` |
|
||||
|
||||
**Example:**
|
||||
```yaml
|
||||
all:
|
||||
type: composer
|
||||
composer: 2
|
||||
package: laravel/installer
|
||||
binary: bin/laravel
|
||||
|
||||
7.1:
|
||||
type: composer
|
||||
version: 2.3.0
|
||||
binary: laravel
|
||||
```
|
||||
|
||||
|
||||
## Second level defines for `type: npm`
|
||||
|
||||
| Yaml key | Required | Supports<br/>Shell code | Description |
|
||||
|-------------|----------|-------------------------|-------------|
|
||||
| `package` | Yes | No | Specify the NPM package name to install |
|
||||
| `version` | No | Yes | Specify the NPM package version to install |
|
||||
| `binary` | No | Yes | Specify the NPM relative binary path to symlink to `/usr/loca/bin/` |
|
||||
|
||||
**Example:**
|
||||
```yaml
|
||||
all:
|
||||
type: npm
|
||||
package: pm2
|
||||
binary: pm2
|
||||
version:
|
||||
```
|
||||
|
||||
|
||||
## Second level defines for `type: pip`
|
||||
|
||||
| Yaml key | Required | Supports<br/>Shell code | Description |
|
||||
|-------------|----------|-------------------------|-------------|
|
||||
| `version` | No | Yes | Specify the Pip package version to install |
|
||||
|
||||
The PyPI package name defaults to the name specified in `options.yml`.
|
||||
|
||||
**Example:**
|
||||
```yaml
|
||||
all:
|
||||
type: pip
|
||||
version:
|
||||
build_dep: []
|
||||
run_dep: []
|
||||
pre:
|
||||
post: |
|
||||
ln -s pwncat /usr/local/bin/netcat \
|
||||
```
|
||||
|
||||
|
||||
## Second level defines for `type: rubygem`
|
||||
|
||||
| Yaml key | Required | Supports<br/>Shell code | Description |
|
||||
|-------------|----------|-------------------------|-------------|
|
||||
| `package` | Yes | No | Specify the Rubygem package name to install |
|
||||
| `version` | No | Yes | Specify the Rubygem package version to install |
|
||||
|
||||
**Example:**
|
||||
```yaml
|
||||
all:
|
||||
type: rubygem
|
||||
package: mdl
|
||||
build_dep: [ruby-dev]
|
||||
run_dep: [ruby]
|
||||
|
||||
7.2:
|
||||
type: rubygem
|
||||
version: 0.11.0
|
||||
pre: |
|
||||
gem install chef-utils -v 16.6.14 \
|
||||
```
|
||||
|
||||
|
||||
## Second level defines for `type: custom`
|
||||
|
||||
| Yaml key | Required | Supports<br/>Shell code | Description |
|
||||
|-------------|----------|-------------------------|-------------|
|
||||
| `command` | Yes | Yes | Custom command to install a tool. |
|
||||
|
||||
**Note:** When using `type: custom`, all data needs to be installed into `/usr/local/bin` as only this directory is copied into the next docker stage during multi-stage build.
|
||||
|
||||
**Example:**
|
||||
```yaml
|
||||
all:
|
||||
type: custom
|
||||
command: curl -sS -k -L --fail -L "${PHP_CS_FIXER_URL}" -o /usr/local/bin/php-cs-fixer
|
||||
pre: PHP_CS_FIXER_URL="https://cs.symfony.com/download/php-cs-fixer-v3.phar"
|
||||
post: chmod +x /usr/local/bin/php-cs-fixer
|
||||
|
||||
7.3:
|
||||
type: custom
|
||||
pre: PHP_CS_FIXER_URL="https://cs.symfony.com/download/php-cs-fixer-v2.phar"
|
||||
```
|
||||
|
||||
|
||||
## Usage of shell code
|
||||
|
||||
### Single-line vs Multi-line
|
||||
|
||||
**Note:** All keys that support shell code can be written as a single line yaml definition or as a multi line yaml definition. Multi-line yaml definitions need a trailing `\` at the end of each line, including the last line.<br/>
|
||||
**Single-line:**
|
||||
```yaml
|
||||
all:
|
||||
pre: VERSION="$( curl http://url | grep -Eo '[0-9.]+' )"
|
||||
```
|
||||
**Multi-line:**
|
||||
```yaml
|
||||
all:
|
||||
pre: |
|
||||
VERSION="$( \
|
||||
curl http://url \
|
||||
| grep -Eo '[0-9.]+' \
|
||||
)" \
|
||||
```
|
||||
|
||||
### Single-command vs Multi-command
|
||||
|
||||
**Note:** All keys that support shell code also support to write multiple shell commands. If you use multiple shell commands, you need to separate them with `&&`.<br/>
|
||||
**Single-command:**
|
||||
```yaml
|
||||
all:
|
||||
pre: |
|
||||
VERSION="$( \
|
||||
curl http://url \
|
||||
| grep -Eo '[0-9.]+' \
|
||||
)" \
|
||||
```
|
||||
**Multi-command:**
|
||||
```yaml
|
||||
all:
|
||||
pre: |
|
||||
URL="http://url" \
|
||||
&& VERSION="$( \
|
||||
curl "${URL} \
|
||||
| grep -Eo '[0-9.]+' \
|
||||
)" \
|
||||
&& echo "${VERSION}" \
|
||||
|
||||
```
|
||||
53
doc/contributor/PHP-TOOL-options.yml.md
Normal file
53
doc/contributor/PHP-TOOL-options.yml.md
Normal file
@@ -0,0 +1,53 @@
|
||||
[PHP Tools: Overview](../../php_tools/README.md) |
|
||||
PHP Tools: `options.yml` |
|
||||
[PHP Tools: `install.yml`](../doc/contributor/PHP-TOOL-install.yml.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Contributor Documentation: PHP Tools</h2>
|
||||
|
||||
|
||||
|
||||
# Tool definition: `options.yml`
|
||||
|
||||
These options are purely for the tool generator to decide whether or not to build the tool and in what order to build it (order of dependencies).
|
||||
|
||||
|
||||
### `name`
|
||||
|
||||
* Required: Yes
|
||||
* Type: `str`
|
||||
|
||||
The lower-case name of the tool (must match directory name).
|
||||
|
||||
|
||||
### `exclude`
|
||||
|
||||
* Required: Yes
|
||||
* Type: `list[str]`
|
||||
* Empty: `[]`
|
||||
|
||||
Add PHP versions to exclude from building/installing this tool. This could be due to build errors or deprecations.
|
||||
|
||||
Example:
|
||||
```yaml
|
||||
# Exclude PHP 5.2 and PHP 5.3
|
||||
exclude: [5.2, 5.3]
|
||||
```
|
||||
|
||||
|
||||
### `depends`
|
||||
|
||||
* Required: Yes
|
||||
* Type: `list[str]`
|
||||
* Empty: `[]`
|
||||
|
||||
If this tool requires another tool to be present prior building/installing (or just to function properly during run-time), you have to specify them in this list. The tool generator will then ensure to build all available tools in order of dependencies.
|
||||
|
||||
Example:
|
||||
```yaml
|
||||
# Before installing the current tool, it will be ensured that
|
||||
# jq is build and installed beforehand.
|
||||
depends_build:
|
||||
- jq
|
||||
```
|
||||
@@ -17,98 +17,226 @@ Env Vars |
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Have a look at the following table to see all supported environment variables for each Docker image flavour.
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Image</th>
|
||||
<th>Env Variable</th>
|
||||
<th>Type</th>
|
||||
<th>Default</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="3"><strong>base</strong><br/><br/><strong>mods</strong><br/><br/><strong>prod</strong><br/><br/><strong>slim</strong><br/><br/><strong>work</strong></td>
|
||||
<td><code>DEBUG_ENTRYPOINT</code></td>
|
||||
<td>int</td>
|
||||
<td><code>0</code></td>
|
||||
<td>Set debug level for startup.<br/><sub><code>0</code> Only warnings and errors are shown.<br/><code>1</code> All log messages are shown<br/><code>2</code> All log messages and executed commands are shown.</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>NEW_UID</code></td>
|
||||
<td>int</td>
|
||||
<td><code>1000</code></td>
|
||||
<td>Assign the PHP-FPM user a new <code>uid</code> in order to syncronize file system permissions with your host computer and the Docker container. You should use a value that matches your host systems local user.<br/><sub>(Type <code>id -u</code> for your uid).</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>NEW_GID</code></td>
|
||||
<td>int</td>
|
||||
<td><code>1000</code></td>
|
||||
<td>Assign the PHP-FPM group a new <code>gid</code> in order to syncronize file system permissions with your host computer and the Docker container. You should use a value that matches your host systems local group.<br/><sub>(Type <code>id -g</code> for your gid).</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="6"><strong>prod</strong><br/><br/><strong>slim</strong><br/><br/><strong>work</strong></td>
|
||||
<td><code>TIMEZONE</code></td>
|
||||
<td>string</td>
|
||||
<td><code>UTC</code></td>
|
||||
<td>Set docker OS timezone as well as PHP timezone.<br/>(Example: <code>Europe/Berlin</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>DOCKER_LOGS</code></td>
|
||||
<td>bool</td>
|
||||
<td><code>1</code></td>
|
||||
<td>By default all Docker images are configured to output their PHP-FPM access and error logs to stdout and stderr. Those which support it can change the behaviour to log into files inside the container. Their respective directories are available as volumes that can be mounted to the host computer. This feature might help developer who are more comfortable with tailing or searching through actual files instead of using docker logs.<br/><br/>Set this variable to <code>0</code> in order to enable logging to files. Log files are avilable under <code>/var/log/php/</code> which is also a docker volume that can be mounted locally.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ENABLE_MODULES</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Comma separated list of PHP modules to enable, which are not enabled by default.<br/><strong>Example:</strong><br/><code>ENABLE_MODULES=blackfire, ioncube, psr, phalcon</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>DISABLE_MODULES</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Comma separated list of PHP modules to disable.<br/><strong>Example:</strong><br/><code>DISABLE_MODULES=swoole,imagick</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ENABLE_MAIL</code></td>
|
||||
<td>bool</td>
|
||||
<td><code>0</code></td>
|
||||
<td>Start local postfix with or without email catch-all.<br/><code>0</code>: Postfix service disabled.<br/><code>1</code>: Postfix service started normally.<br/><code>2</code>: Postfix service started configured for local delivery and all mails sent (even to real domains) will be catched locally. No email will ever go out. They will all be stored in a local devilbox account.<br/>Value: <code>0</code>, <code>1</code> or <code>2</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>FORWARD_PORTS_TO_LOCALHOST</code></td>
|
||||
<td>string</td>
|
||||
<td></td>
|
||||
<td>List of remote ports to forward to 127.0.0.1.<br/><strong>Format:</strong><br/><sub><code><local-port>:<remote-host>:<remote-port></code></sub><br/>You can separate multiple entries by comma.<br/><strong>Example:</strong><br/><sub><code>3306:mysqlhost:3306, 6379:192.0.1.1:6379</code></sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3"><strong>slim</strong><br/><br/><strong>work</strong></td>
|
||||
<td><code>MYSQL_BACKUP_USER</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Username for mysql backups used for bundled <a href="https://mysqldump-secure.org" >mysqldump-secure</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>MYSQL_BACKUP_PASS</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Password for mysql backups used for bundled <a href="https://mysqldump-secure.org" >mysqldump-secure</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>MYSQL_BACKUP_HOST</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Hostname for mysql backups used for bundled <a href="https://mysqldump-secure.org" >mysqldump-secure</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
1. [Overview](#overview)
|
||||
2. [`DEBUG_ENTRYPOINT`][lnk_env_debug]
|
||||
3. [`NEW_UID`][lnk_env_uid]
|
||||
4. [`NEW_GID`][lnk_env_gid]
|
||||
5. [`TIMEZONE`][lnk_env_timezone]
|
||||
6. [`DOCKER_LOGS`][lnk_env_logs]
|
||||
7. [`ENABLE_MODULES`][lnk_env_enable_mods]
|
||||
8. [`DISABLE_MODULES`][lnk_env_disable_mods]
|
||||
9. [`ENABLE_MAIL`][lnk_env_enable_mail]
|
||||
10. [`FORWARD_PORTS_TO_LOCALHOST`][lnk_env_forward]
|
||||
11. [`MYSQL_BACKUP_USER`][lnk_env_backup_user]
|
||||
12. [`MYSQL_BACKUP_PASS`][lnk_env_backup_pass]
|
||||
13. [`MYSQL_BACKUP_HOST`][lnk_env_backup_host]
|
||||
|
||||
[lnk_env_debug]: #-debug_entrypoint
|
||||
[lnk_env_uid]: #-new_uid
|
||||
[lnk_env_gid]: #-new_gid
|
||||
[lnk_env_timezone]: #-timezone
|
||||
[lnk_env_logs]: #-docker_logs
|
||||
[lnk_env_enable_mods]: #-enable_modules
|
||||
[lnk_env_disable_mods]: #-disable_modules
|
||||
[lnk_env_enable_mail]: #-enable_mail
|
||||
[lnk_env_forward]: #-forward_ports_to_localhost
|
||||
[lnk_env_backup_user]: #-mysql_backup_user
|
||||
[lnk_env_backup_pass]: #-mysql_backup_pass
|
||||
[lnk_env_backup_host]: #-mysql_backup_host
|
||||
|
||||
|
||||
### Overview
|
||||
|
||||
The following table gives an overview about which environment variable is available to which flavour.
|
||||
|
||||
| Environment Variable | `base` | `mods` | `prod` | `slim` | `work` |
|
||||
|------------------------------|--------|--------|--------|--------|--------|
|
||||
| `DEBUG_ENTRYPOINT` | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| `NEW_UID` | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| `NEW_GID` | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| `TIMEZONE` | | | ✓ | ✓ | ✓ |
|
||||
| `DOCKER_LOGS` | | | ✓ | ✓ | ✓ |
|
||||
| `ENABLE_MODULES` | | | ✓ | ✓ | ✓ |
|
||||
| `DISABLE_MODULES` | | | ✓ | ✓ | ✓ |
|
||||
| `ENABLE_MAIL` | | | ✓ | ✓ | ✓ |
|
||||
| `FORWARD_PORTS_TO_LOCALHOST` | | | ✓ | ✓ | ✓ |
|
||||
| `MYSQL_BACKUP_USER` | | | | ✓ | ✓ |
|
||||
| `MYSQL_BACKUP_PASS` | | | | ✓ | ✓ |
|
||||
| `MYSQL_BACKUP_HOST` | | | | ✓ | ✓ |
|
||||
|
||||
|
||||
### ∑ `DEBUG_ENTRYPOINT`
|
||||
|
||||
This variable controls the debug level (verbosity) for the container startup. The more verbose, the more information is shown via docker logs during startup.
|
||||
|
||||
* **Var type:** `int`
|
||||
* **Default:** `0`
|
||||
* **Allowed:** `0`, `1`, `2`
|
||||
|
||||
When set to `0` (default), only errors and warnings are shown.
|
||||
When set to `1`, all log messages are shown.
|
||||
When set to `2`, all log messages and all commands that are being executed by the entrypoint script are shown.
|
||||
|
||||
|
||||
### ∑ `NEW_UID`
|
||||
|
||||
This variable controls the user id of the php-fpm process.
|
||||
|
||||
* **Var type:** `int`
|
||||
* **Default:** `1000`
|
||||
* **Allowed:** any valid user id (use your local users' `uid`)
|
||||
|
||||
> **Backgrund:** The php-fpm docker image has a non-root user (and group) that the php-fpm process runs with. When one of your PHP scripts creates a file (cache, uploads, etc), it is being created with the user id and group id, the php-fpm process runs with. In order to make sure this is the same user id as your normal user locally on the host system, this env variable can be used to change the user id inside the container (during startup).
|
||||
Why can't the php-fpm process run as root? It would then create files with root permissions and as those files are actually on your host system, you would require root permission to access/edit them again.
|
||||
>
|
||||
> You can read more about this topic here: [Syncronize file and folder Permissions](syncronize-file-permissions.md).
|
||||
|
||||
You want the PHP-FPM process to run with the same **user id** as the user on your host system.
|
||||
|
||||
What value should I set this to? Open up a terminal on your host system and type **`id -u`** to find out the user id of your local user.
|
||||
|
||||
|
||||
### ∑ `NEW_GID`
|
||||
|
||||
This variable controls the group id of the php-fpm process.
|
||||
|
||||
* **Var type:** `int`
|
||||
* **Default:** `1000`
|
||||
* **Allowed:** any valid group id (use your local users' `gid`)
|
||||
|
||||
> **Background:** See the section in `NEW_UID`
|
||||
|
||||
You want the PHP-FPM process to run with the same **group id **as the user on your host system.
|
||||
|
||||
What value should I set this to? Open up a terminal on your host system and type **`id -g`** to find out the group id of your local user.
|
||||
|
||||
|
||||
### ∑ `TIMEZONE`
|
||||
|
||||
This variable sets the timezone for the container as well as for the PHP-FPM process (via php.ini directives).
|
||||
|
||||
* **Var type:** `string`
|
||||
* **Default:** `UTC`
|
||||
* **Allowed:** any valid timezone (e.g.: `Europe/Berlin`)
|
||||
|
||||
|
||||
### ∑ `DOCKER_LOGS`
|
||||
|
||||
This variable controls whether PHP access and error logs are written to a log file inside the container or shown via docker logs.
|
||||
|
||||
* **Var type:** `bool`
|
||||
* **Default:** `1`
|
||||
* **Allowed:** `0` or `1`
|
||||
|
||||
By default (value: `1`) all Docker images are configured to output their PHP-FPM access and error logs to stdout and stderr, which means it is shown by `docker logs` (or `docker-compose logs`).
|
||||
|
||||
If you want to log into files inside the container instead, change it to `0`. The respective log files are available as Docker volumes and can be mounted to your local file system so you can `cat`, `tail` or `grep` them for anything interesting.
|
||||
|
||||
|
||||
### ∑ `ENABLE_MODULES`
|
||||
|
||||
Some PHP extensions are not enabled by default (e.g.: `blackfire`, `ioncube`, `swoole` and others). See [PHP modules](php-modules.md) to find out availalable modules and which are enabled/disabled by default. This variable explicitly enabled PHP modules during startup.
|
||||
|
||||
* **Var type:** comma separated `string` of modules to enable
|
||||
* **Default:** ``
|
||||
* **Allowed:** available modules as a commaa separated string
|
||||
|
||||
Example:
|
||||
```bash
|
||||
ENABLE_MODULES=swoole
|
||||
ENABLE_MODULES=swoole,psr,phalcon
|
||||
```
|
||||
|
||||
### ∑ `DISABLE_MODULES`
|
||||
|
||||
The PHP-FPM images come with lots of available and default-enabled PHP modules. You might not need all of them. This variable controls which of the modules you want to disable explicitly during startup.
|
||||
|
||||
**Note:** Not all modules can be disabled, as some of them are directly compiled into PHP itself. See [PHP modules](php-modules.md) to find out, which modules can be disabled.
|
||||
|
||||
* **Var type:** comma separated `string` of modules to disabled
|
||||
* **Default:** ``
|
||||
* **Allowed:** available modules as a commaa separated string
|
||||
|
||||
Example:
|
||||
```bash
|
||||
DISABLE_MODULES=imagick
|
||||
DISABLE_MODULES=imagick,xdebug
|
||||
```
|
||||
|
||||
|
||||
### ∑ `ENABLE_MAIL`
|
||||
|
||||
This variable controls whether Postfix (smtpd) should run and how it should behave, when your PHP code sends emails. It can be configured to intercept any outbound send emails and keep them locally, so that you do not accidentally send mails out.
|
||||
|
||||
* **Var type:** `int`
|
||||
* **Default:** `0`
|
||||
* **Allowed:** `0`, `1` or `2`
|
||||
|
||||
By default (value: `0`), the Postfix service is disabled and not started locally inside the Docker container.
|
||||
|
||||
When set to `1`, the Postfix service is started normally with its out-of-the-box default configuration.
|
||||
|
||||
When set to `2`, the Postfix service is started and configured for local delivery. That means that all mails sent (even to real existing domains) are intercepted and catched locally. No email will ever leave the system. The emails are then stored in the `devilbox` users' mail file locally in the container. Its directory can also be mounted to your local file system to browse the mails that have been sent.
|
||||
|
||||
|
||||
### ∑ `FORWARD_PORTS_TO_LOCALHOST`
|
||||
|
||||
This variable allows you to forward remote ports to `127.0.0.1` into the PHP-FPM docker container. This might be handy if you have another MySQL database container running and still want to be able to use `127.0.0.1` in your PHP configuration for the database host.
|
||||
|
||||
* **Var type:** `string`
|
||||
* **Default:** ``
|
||||
* **Allowed:** `<local-port>:<remote-host>:<remote-port>`
|
||||
|
||||
**Note:** You can forward multiple ports by comma separating the allowd forwarding string.
|
||||
|
||||
Forward a remote MySQL database locally to port 3307
|
||||
```bash
|
||||
# Remote MYSQL host/ip: mysqlhost
|
||||
# Remote MYSQL port: 3306
|
||||
# Local port to forward to: 3307
|
||||
FORWARD_PORTS_TO_LOCALHOST=3307:mysqlhost:3306
|
||||
```
|
||||
|
||||
Forward a remote MySQL and PostgreSQL locally to port 3307 and 5433
|
||||
```bash
|
||||
# Remote MYSQL host/ip: mysqlhost
|
||||
# Remote MYSQL port: 3306
|
||||
# Local port to forward to: 3307
|
||||
|
||||
# Remote PGSQL host/ip: pgsqlhost
|
||||
# Remote PGSQL port: 5432
|
||||
# Local port to forward to: 5433
|
||||
FORWARD_PORTS_TO_LOCALHOST=3307:mysqlhost:3306, 5433:pgsqlhost:5432
|
||||
```
|
||||
|
||||
|
||||
### ∑ `MYSQL_BACKUP_USER`
|
||||
|
||||
You can just type `mysqldump-secure` inside the PHP-FPM container to easily backup your MySQL databases with one command. (See project: https://mysqldump-secure.org/).
|
||||
In order to do so, you will need to pass a MySQL user to the PHP-FPM container, so it can auto-configure mysqldump-secure for you.
|
||||
|
||||
* **Var type:** `string`
|
||||
* **Default:** ``
|
||||
* **Allowed:** valid mysql user name
|
||||
|
||||
|
||||
### ∑ `MYSQL_BACKUP_PASS`
|
||||
|
||||
You can just type `mysqldump-secure` inside the PHP-FPM container to easily backup your MySQL databases with one command. (See project: https://mysqldump-secure.org/).
|
||||
In order to do so, you will need to pass a MySQL password to the PHP-FPM container, so it can auto-configure mysqldump-secure for you.
|
||||
|
||||
* **Var type:** `string`
|
||||
* **Default:** ``
|
||||
* **Allowed:** valid mysql password
|
||||
|
||||
|
||||
### ∑ `MYSQL_BACKUP_HOST`
|
||||
|
||||
You can just type `mysqldump-secure` inside the PHP-FPM container to easily backup your MySQL databases with one command. (See project: https://mysqldump-secure.org/).
|
||||
In order to do so, you will need to pass a MySQL hostname to the PHP-FPM container, so it can auto-configure mysqldump-secure for you.
|
||||
|
||||
* **Var type:** `string`
|
||||
* **Default:** ``
|
||||
* **Allowed:** valid hostname
|
||||
|
||||
**Note:** The hostname must be reachable from within the PHP-FPM container.
|
||||
|
||||
@@ -17,65 +17,95 @@ Volumes |
|
||||
|
||||
### Docker Volumes
|
||||
|
||||
Have a look at the following table to see all offered volumes for each Docker image flavour.
|
||||
1. [Overview](#overview)
|
||||
2. [`/etc/php-custom.d/`][lnk_vol_php_custom]
|
||||
3. [`/etc/php-fpm-custom.d/`][lnk_vol_php_fpm_custom]
|
||||
4. [`/startup.1.d/`][lnk_vol_startup1]
|
||||
5. [`/startup.2.d/`][lnk_vol_startup2]
|
||||
6. [`/var/log/php/`][lnk_vol_log_php]
|
||||
7. [`/var/mail/`][lnk_vol_mail]
|
||||
8. [`/etc/supervisor/custom.d/`][lnk_vol_supervisor]
|
||||
9. [`/etc/bashrc-devilbox.d/`][lnk_vol_bashrc]
|
||||
10. [`/shared/backups/`][lnk_vol_backups]
|
||||
11. [`/ca/`][lnk_vol_ca]
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Image</th>
|
||||
<th width="240">Volumes</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="8"><strong>prod</strong><br/><br/><strong>slim</strong><br/><br/><strong>work</strong></td>
|
||||
<td><code>/etc/php-custom.d</code></td>
|
||||
<td>Mount this directory into your host computer and add custom <code>\*.ini</code> files in order to alter php behaviour.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/etc/php-fpm-custom.d</code></td>
|
||||
<td>Mount this directory into your host computer and add custom PHP-FPM <code>\*.conf</code> files in order to alter PHP-FPM behaviour.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/etc/php-modules.d</code></td>
|
||||
<td>Mount this directory into your host computer and add custo <code>\*.so</code> files in order to add your php modules.<br/><br/><strong>Note:</strong>Your should then also provide a custom <code>\*.ini</code> file in order to actually load your custom provided module.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/startup.1.d</code></td>
|
||||
<td>Any executable scripts ending by <code>\*.sh</code> found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run before <code>/startup.2.d</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/startup.2.d</code></td>
|
||||
<td>Any executable scripts ending by <code>\*.sh</code> found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run after <code>/startup.1.d</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/var/log/php</code></td>
|
||||
<td>When setting environment variable <code>DOCKER_LOGS</code> to <code>0</code>, log files will be available under this directory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/var/mail</code></td>
|
||||
<td>Emails caught be the postfix catch-all (<code>ENABLE_MAIL=2</code>) will be available in this directory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/etc/supervisor/custom.d</code></td>
|
||||
<td>Mount this directory into your host computer and add your own `*.conf` supervisor start-up files.<br/><br/>**Note:** Directory and file permission will be recursively set to this of `NEW_UID` and `NEW_GID`.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3"><strong>slim</strong><br/><br/><strong>work</strong></td>
|
||||
<td><code>/etc/bashrc-devilbox.d</code></td>
|
||||
<td>Mount this directory into your host computer and add custom configuration files for <code>bash</code> and other tools.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/shared/backups</code></td>
|
||||
<td>Mount this directory into your host computer to access MySQL backups created by <a href="https://mysqldump-secure.org" >mysqldump-secure</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/ca</code></td>
|
||||
<td>Mount this directory into your host computer to bake any *.crt file that is located in there as a trusted SSL entity.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
[lnk_vol_php_custom]: #-etcphp-customd
|
||||
[lnk_vol_php_fpm_custom]: #-etcphp-fpm-customd
|
||||
[lnk_vol_startup1]: #-startup1d
|
||||
[lnk_vol_startup2]: #-startup2d
|
||||
[lnk_vol_log_php]: #-varlogphp
|
||||
[lnk_vol_mail]: #-varmail
|
||||
[lnk_vol_supervisor]: #-etcsupervisorcustomd
|
||||
[lnk_vol_bashrc]: #-etcbashrc-devilboxd
|
||||
[lnk_vol_backups]: #-sharedbackups
|
||||
[lnk_vol_ca]: #-ca
|
||||
|
||||
|
||||
### Overview
|
||||
|
||||
The following table gives an overview about which volume is available to which flavour.
|
||||
|
||||
| Docker Volume | `base` | `mods` | `prod` | `slim` | `work` |
|
||||
|-----------------------------|--------|--------|--------|--------|--------|
|
||||
| `/etc/php-custom.d/` | | | ✓ | ✓ | ✓ |
|
||||
| `/etc/php-fpm-custom.d/` | | | ✓ | ✓ | ✓ |
|
||||
| `/startup.1.d/` | | | ✓ | ✓ | ✓ |
|
||||
| `/startup.2.d/` | | | ✓ | ✓ | ✓ |
|
||||
| `/var/log/php/` | | | ✓ | ✓ | ✓ |
|
||||
| `/var/mail/` | | | ✓ | ✓ | ✓ |
|
||||
| `/etc/supervisor/custom.d/` | | | ✓ | ✓ | ✓ |
|
||||
| `/etc/bashrc-devilbox.d/` | | | | ✓ | ✓ |
|
||||
| `/shared/backups/` | | | | ✓ | ✓ |
|
||||
| `/ca/` | | | | ✓ | ✓ |
|
||||
|
||||
|
||||
### 📂 `/etc/php-custom.d/`
|
||||
|
||||
Mount this directory into your host system and add custom PHP `*.ini` files in order to alter PHP behaviour.
|
||||
|
||||
|
||||
### 📂 `/etc/php-fpm-custom.d/`
|
||||
|
||||
Mount this directory into your host system and add custom PHP-FPM `*.conf` files in order to alter PHP-FPM behaviour.
|
||||
|
||||
|
||||
### 📂 `/startup.1.d/`
|
||||
|
||||
Any executable scripts ending by `*.sh` found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run before `/startup.2.d`).
|
||||
|
||||
|
||||
### 📂 `/startup.2.d/`
|
||||
|
||||
Any executable scripts ending by `*.sh` found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run after `/startup.1.d`).
|
||||
|
||||
|
||||
### 📂 `/var/log/php/`
|
||||
|
||||
When setting environment variable `DOCKER_LOGS` to `0`, PHP and PHP-FPM log files will be available in this directory.
|
||||
|
||||
|
||||
### 📂 `/var/mail/`
|
||||
|
||||
Emails caught be the postfix catch-all (`ENABLE_MAIL=2`) will be available in this directory.
|
||||
|
||||
|
||||
### 📂 `/etc/supervisor/custom.d/`
|
||||
|
||||
Mount this directory into your host computer and add your own `*.conf` supervisor start-up files.
|
||||
|
||||
**Note:** Directory and file permission will be recursively set to this of `NEW_UID` and `NEW_GID`.
|
||||
|
||||
|
||||
### 📂 `/etc/bashrc-devilbox.d/`
|
||||
|
||||
Mount this directory into your host computer and add custom configuration files for `bash` and other tools.
|
||||
|
||||
|
||||
### 📂 `/shared/backups/`
|
||||
|
||||
Mount this directory into your host computer to access MySQL backups created by [mysqldump-secure](https://mysqldump-secure.org/).
|
||||
|
||||
|
||||
### 📂 `/ca/`
|
||||
|
||||
Mount this directory into your host computer to bake any `*.crt` file that is located in there as a trusted SSL entity.
|
||||
|
||||
@@ -17,22 +17,35 @@ Flavours |
|
||||
|
||||
### Flavours
|
||||
|
||||
#### Image: base
|
||||
Flavours are just different PHP-FPM images that are build on top of each other. Each layer adding more functionality. This makes it easier to separate images based on certain criterias and allows the user to pick a flavor that suits.
|
||||
|
||||
|
||||
#### base
|
||||
|
||||
> **builds from:** Official PHP images
|
||||
|
||||
Generic PHP-FPM base image. Use it to derive your own php-fpm docker image from it and add more extensions, tools and injectables.<br/><sub>(Does not offer any environment variables except for `NEW_UID` and `NEW_GID`)</sub>
|
||||
|
||||
#### Image: mods
|
||||
#### mods
|
||||
|
||||
> **build from:** devilbox/php-fpm `base` flavour
|
||||
|
||||
Generic PHP-FPM image with fully loaded extensions. Use it to derive your own php-fpm docker image from it and add more extensions, tools and injectables.<br/><sub>(Does not offer any environment variables except for `NEW_UID` and `NEW_GID`)</sub>
|
||||
|
||||
#### Image: prod
|
||||
#### prod
|
||||
|
||||
> **build from:** devilbox/php-fpm `mods` flavour
|
||||
|
||||
Devilbox production image. This Docker image comes with many injectables, port-forwardings, mail-catch-all and user/group rewriting.
|
||||
|
||||
#### Image: slim
|
||||
#### slim
|
||||
|
||||
> **build from:** devilbox/php-fpm `prod` flavour
|
||||
|
||||
Devilbox intranet-ready image. Similar to `prod`, but contains least subset of required cli tools to make the Devilbox intranet work.
|
||||
|
||||
#### Image: work
|
||||
#### work
|
||||
|
||||
Devilbox development image. Same as prod, but comes with lots of locally installed tools to make development inside the container as convenient as possible. See [Integrated Development Environment](../README.md#integrated-development-environment) for more information about this.
|
||||
> **build from:** devilbox/php-fpm `slim` flavour
|
||||
|
||||
Devilbox development image. Same as `slim`, but comes with lots of locally installed [tools](available-tools.md) to make development inside the container as convenient as possible. See [Integrated Development Environment](../README.md#integrated-development-environment) for more information about this.
|
||||
|
||||
@@ -637,9 +637,9 @@ The following PHP modules are available on the `base` flavour:
|
||||
|
||||
|
||||
|
||||
### PHP Modules (`mods`, `prod` and `work`)
|
||||
### PHP Modules (`mods`, `prod`, `slim` and `work`)
|
||||
|
||||
The following PHP modules are available on the `mods`, `prod` and `work` flavour:
|
||||
The following PHP modules are available on the `mods`, `prod`, `slim` and `work` flavour:
|
||||
|
||||
> :information_source: Click on any extension name to find out what they are
|
||||
|
||||
|
||||
@@ -17,18 +17,18 @@ Versions |
|
||||
|
||||
### Available PHP versions
|
||||
|
||||
| Version | Architecture | Flavours |
|
||||
|--------------------------|-------------------------|----------|
|
||||
| :elephant: **`PHP 5.2`** | :computer: amd64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-5.2), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-5.2), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-5.2), :file_folder: [work](../Dockerfiles/work/Dockerfile-5.2) |
|
||||
| :elephant: **`PHP 5.3`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-5.3), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-5.3), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-5.3), :file_folder: [work](../Dockerfiles/work/Dockerfile-5.3) |
|
||||
| :elephant: **`PHP 5.4`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-5.4), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-5.4), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-5.4), :file_folder: [work](../Dockerfiles/work/Dockerfile-5.4) |
|
||||
| :elephant: **`PHP 5.5`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-5.5), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-5.5), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-5.5), :file_folder: [work](../Dockerfiles/work/Dockerfile-5.5) |
|
||||
| :elephant: **`PHP 5.6`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-5.6), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-5.6), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-5.6), :file_folder: [work](../Dockerfiles/work/Dockerfile-5.6) |
|
||||
| :elephant: **`PHP 7.0`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-7.0), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-7.0), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-7.0), :file_folder: [work](../Dockerfiles/work/Dockerfile-7.0) |
|
||||
| :elephant: **`PHP 7.1`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-7.1), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-7.1), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-7.1), :file_folder: [work](../Dockerfiles/work/Dockerfile-7.1) |
|
||||
| :elephant: **`PHP 7.2`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-7.2), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-7.2), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-7.2), :file_folder: [work](../Dockerfiles/work/Dockerfile-7.2) |
|
||||
| :elephant: **`PHP 7.3`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-7.3), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-7.3), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-7.3), :file_folder: [work](../Dockerfiles/work/Dockerfile-7.3) |
|
||||
| :elephant: **`PHP 7.4`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-7.4), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-7.4), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-7.4), :file_folder: [work](../Dockerfiles/work/Dockerfile-7.4) |
|
||||
| :elephant: **`PHP 8.0`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-8.0), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-8.0), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-8.0), :file_folder: [work](../Dockerfiles/work/Dockerfile-8.0) |
|
||||
| :elephant: **`PHP 8.1`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-8.1), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-8.1), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-8.1), :file_folder: [work](../Dockerfiles/work/Dockerfile-8.1) |
|
||||
| :elephant: **`PHP 8.2`** | :computer: amd64, arm64 | :file_folder: [base](../Dockerfiles/base/Dockerfile-8.2), :file_folder: [mods](../Dockerfiles/mods/Dockerfile-8.2), :file_folder: [prod](../Dockerfiles/prod/Dockerfile-8.2), :file_folder: [work](../Dockerfiles/work/Dockerfile-8.2) |
|
||||
| Version | Architecture | Flavours |
|
||||
|------------------|-----------------|----------|
|
||||
| 🐘 **`PHP 5.2`** | 💻 amd64 | 📂 [base](../Dockerfiles/base/Dockerfile-5.2), 📂 [mods](../Dockerfiles/mods/Dockerfile-5.2), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.2), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.2), 📂 [work](../Dockerfiles/work/Dockerfile-5.2) |
|
||||
| 🐘 **`PHP 5.3`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-5.3), 📂 [mods](../Dockerfiles/mods/Dockerfile-5.3), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.3), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.3), 📂 [work](../Dockerfiles/work/Dockerfile-5.3) |
|
||||
| 🐘 **`PHP 5.4`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-5.4), 📂 [mods](../Dockerfiles/mods/Dockerfile-5.4), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.4), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.4), 📂 [work](../Dockerfiles/work/Dockerfile-5.4) |
|
||||
| 🐘 **`PHP 5.5`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-5.5), 📂 [mods](../Dockerfiles/mods/Dockerfile-5.5), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.5), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.5), 📂 [work](../Dockerfiles/work/Dockerfile-5.5) |
|
||||
| 🐘 **`PHP 5.6`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-5.6), 📂 [mods](../Dockerfiles/mods/Dockerfile-5.6), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.6), 📂 [slim](../Dockerfiles/slim/Dockerfile-5.6), 📂 [work](../Dockerfiles/work/Dockerfile-5.6) |
|
||||
| 🐘 **`PHP 7.0`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-7.0), 📂 [mods](../Dockerfiles/mods/Dockerfile-7.0), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.0), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.0), 📂 [work](../Dockerfiles/work/Dockerfile-7.0) |
|
||||
| 🐘 **`PHP 7.1`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-7.1), 📂 [mods](../Dockerfiles/mods/Dockerfile-7.1), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.1), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.1), 📂 [work](../Dockerfiles/work/Dockerfile-7.1) |
|
||||
| 🐘 **`PHP 7.2`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-7.2), 📂 [mods](../Dockerfiles/mods/Dockerfile-7.2), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.2), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.2), 📂 [work](../Dockerfiles/work/Dockerfile-7.2) |
|
||||
| 🐘 **`PHP 7.3`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-7.3), 📂 [mods](../Dockerfiles/mods/Dockerfile-7.3), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.3), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.3), 📂 [work](../Dockerfiles/work/Dockerfile-7.3) |
|
||||
| 🐘 **`PHP 7.4`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-7.4), 📂 [mods](../Dockerfiles/mods/Dockerfile-7.4), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.4), 📂 [slim](../Dockerfiles/slim/Dockerfile-7.4), 📂 [work](../Dockerfiles/work/Dockerfile-7.4) |
|
||||
| 🐘 **`PHP 8.0`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-8.0), 📂 [mods](../Dockerfiles/mods/Dockerfile-8.0), 📂 [slim](../Dockerfiles/slim/Dockerfile-8.0), 📂 [slim](../Dockerfiles/slim/Dockerfile-8.0), 📂 [work](../Dockerfiles/work/Dockerfile-8.0) |
|
||||
| 🐘 **`PHP 8.1`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-8.1), 📂 [mods](../Dockerfiles/mods/Dockerfile-8.1), 📂 [slim](../Dockerfiles/slim/Dockerfile-8.1), 📂 [slim](../Dockerfiles/slim/Dockerfile-8.1), 📂 [work](../Dockerfiles/work/Dockerfile-8.1) |
|
||||
| 🐘 **`PHP 8.2`** | 💻 amd64, arm64 | 📂 [base](../Dockerfiles/base/Dockerfile-8.2), 📂 [mods](../Dockerfiles/mods/Dockerfile-8.2), 📂 [slim](../Dockerfiles/slim/Dockerfile-8.2), 📂 [slim](../Dockerfiles/slim/Dockerfile-8.2), 📂 [work](../Dockerfiles/work/Dockerfile-8.2) |
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
PHP Mods: Overview |
|
||||
[PHP Mods: `options.yml`](../doc/contributor/PHP-EXT-options.yml.md) |
|
||||
[PHP Mods: `build.yml`](../doc/contributor/PHP-EXT-build.yml.md) |
|
||||
[PHP Mods: `test.yml`](../doc/contributor/PHP-EXT-test.yml.md)
|
||||
[PHP Mods: `install.yml`](../doc/contributor/PHP-EXT-install.yml.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -9,49 +8,151 @@ PHP Mods: Overview |
|
||||
|
||||
|
||||
|
||||
# PHP Module definitions
|
||||
## PHP Module definitions
|
||||
|
||||
This document describes how to create new or alter existing PHP module definitions.
|
||||
This document describes how to create new or alter existing PHP modules.
|
||||
|
||||
All PHP modules/extensions (for all PHP versions and both for `amd64` and `arm64` platforms) are defined in the `php_modules/` directory in their corresponding sub directory. These definitions are then transformed to Ansible group_vars and afterwards Ansible will generate the corresponding Dockerfiles (Stage: `mods`).
|
||||
All PHP modules (for all PHP versions and both for `amd64` and `arm64` platforms) are defined in the `php_modules/` directory in their corresponding sub directory. Modules defined in there will be built for the `mods` flavour.
|
||||
|
||||
**Directory Structure:**
|
||||
```bash
|
||||
php_modules/
|
||||
└── <php-mod>/
|
||||
├── install.yml
|
||||
├── options.yml
|
||||
└── README.md
|
||||
```
|
||||
|
||||
|
||||
### Requirements
|
||||
|
||||
In order to create new or altere existing PHP modules you need to have the following tools installed locally:
|
||||
* Python3
|
||||
* Python [`PyYAML`](https://pypi.org/project/PyYAML/) module
|
||||
* Docker
|
||||
* The `make` command
|
||||
|
||||
Additionally you should have a brief understanding about what flavours exist and how they derive from each other: **[Documentation: Flavours](../doc/flavours.md)**.
|
||||
|
||||
|
||||
## How to add PHP modules?
|
||||
|
||||
> **Note:** The below listed steps require you to have the following on your local machine installed: `python3`, `PyYAML` Python module, `docker` and `make`.
|
||||
Simply add your new module definitions into `php_modules/` as shown in the above directory structure.
|
||||
|
||||
1. **Inside `php_modules/` directory:**
|
||||
1. Create a new directory with the name of the PHP module in `php_modules/`
|
||||
2. Add `build.yml`, `options.yml` and `test.yml` into your newly created directory
|
||||
3. Alter `build.yml`, `options.yml` and `test.yml` according to documentation below
|
||||
You can either look at existing modules to find out what needs to be added to `install.yml` and `options.yml` or you check out the documentation for that:
|
||||
|
||||
2. **Inside the root of this git repository:**
|
||||
1. Run `make gen-dockerfiles` to generate Dockerfiles via Ansible
|
||||
2. Run `make build STAGE=mods VERSION=8.1 ARCH=linux/amd64` to build the `mods` Docker image with version `8.1` for platform `linux/amd64`
|
||||
* See **[PHP-EXT-install.yml.md](../doc/contributor/PHP-EXT-install.yml.md)** how to alter the `install.yml` file.
|
||||
* See **[PHP-EXT-options.yml.md](../doc/contributor/PHP-EXT-options.yml.md)** how to alter the `options.yml` file.
|
||||
|
||||
**Note:** If you want to test if your new module builds correctly, you can generate Dockerfiles which only contain this one module and all others removed. This allows for much faster Docker builds and you don't have to wait for all other modules to be built. To do so, generate only group_vars for your one module via:
|
||||
Below is a simple example of how the `xls` module was created:
|
||||
|
||||
```bash
|
||||
# Commands shown here are executed from root of this repository
|
||||
# Enter the php_modules directory
|
||||
cd php_modules/
|
||||
|
||||
# Only generate Dockerfiles with PHP extension curl
|
||||
# Note: if curl has other modules as requirements to be built beforehand, those will also be added
|
||||
make gen-dockerfiles MODS="curl"
|
||||
# Create the xls directory
|
||||
mkdir xls
|
||||
|
||||
# Create necessary empty files
|
||||
touch xls/install.yml
|
||||
touch xls/options.yml
|
||||
```
|
||||
|
||||
:information_source: For details on how to generate modules see **[Abuser Documentation: Build your own image](../doc/abuser/README.md)**
|
||||
Now let's edit `options.yml`:
|
||||
```yaml
|
||||
---
|
||||
name: xls # The name must match the directory name
|
||||
exclude: [] # Any PHP versions to exclude?
|
||||
|
||||
depends_build: [libxml] # The libxml module must be built before xls
|
||||
```
|
||||
|
||||
Now let's edit the `install.yml`:
|
||||
```yaml
|
||||
---
|
||||
all:
|
||||
type: builtin
|
||||
build_dep: [libxslt-dev] # This Debian package is required to build xls
|
||||
run_rep: [libxslt1.1] # This Debian package is required during run-time
|
||||
```
|
||||
|
||||
|
||||
## Extension definition: `build.yml`
|
||||
## How to generate the Dockerfiles?
|
||||
|
||||
See **[PHP-EXT-build.yml.md](../doc/contributor/PHP-EXT-build.yml.md)** how to alter the `build.yml` file.
|
||||
Dockerfiles are generated for all PHP versions with a single `make` command. If you do not specify any arguments, then all PHP modules found in the `php_modules/` directory are being added to the Dockerfiles.
|
||||
|
||||
You can however also generate Dockerfiles only containing the module that you have created/altered. This makes the `docker build` process much faster and you can troubleshoot potential errors quicker.
|
||||
|
||||
### Generate Dockerfiles for all PHP modules
|
||||
|
||||
Inside the root of this git repository execute the following:
|
||||
```bash
|
||||
# Generate Dockerfiles with all available PHP modules found in php_modules/ dir
|
||||
make gen-dockerfiles
|
||||
```
|
||||
|
||||
### Generate Dockerfiles for a single PHP module
|
||||
|
||||
Inside the root of this git repository execute the following:
|
||||
```bash
|
||||
# Generate Dockerfiles with only xls module
|
||||
make gen-dockerfiles PHP_MODS="xls"
|
||||
```
|
||||
|
||||
> **🛈 Note:** This will also add any modules that `xls` depends on (specified via `depends_build:` in `options.yml`)
|
||||
|
||||
You can also exlcude any dependent modules by specifying the `-i` flag.
|
||||
|
||||
```bash
|
||||
# Generate Dockerfiles with only xls module and no dependent modules
|
||||
make gen-dockerfiles PHP_MODS="-i xls"
|
||||
```
|
||||
|
||||
> **⚠ Warning:** The `-i` option might break your build.
|
||||
|
||||
### Generate Dockerfiles for multiple PHP modules
|
||||
|
||||
Inside the root of this git repository execute the following:
|
||||
```bash
|
||||
# Generate Dockerfiles with only xls and xmlwriter module
|
||||
make gen-dockerfiles PHP_MODS="xls xmlwriter"
|
||||
```
|
||||
|
||||
> **🛈 Note:** This will also add any modules that `xls` and `xmlwriter` depends on (specified via `depends_build:` in `options.yml`)
|
||||
|
||||
You can also exlcude any dependent modules by specifying the `-i` flag.
|
||||
|
||||
```bash
|
||||
# Generate Dockerfiles with only xls and xmlwriter module and no dependent modules
|
||||
make gen-dockerfiles PHP_MODS="-i xls xmlwriter"
|
||||
```
|
||||
|
||||
|
||||
## Extension definition: `options.yml`
|
||||
## How to build the Dockerfiles?
|
||||
|
||||
See **[PHP-EXT-options.yml.md](../doc/contributor/PHP-EXT-options.yml.md)** how to alter the `options.yml` file.
|
||||
Once you have generated the Dockerfiles, pick a PHP version and an architecture (`linux/am64` or `linux/arm64`) and then build it via `make`.
|
||||
|
||||
> **🛈 Note 1:** PHP modules are generated into Dockerfiles of the `mods` flavour, so you will have to use `STAGE=mods` to build this flavour.<br/>
|
||||
> **🛈 Note 2:** The `mods` flavour depends on the `base` flavour, so you need to ensure to either pull this Docker image or build it yourself.
|
||||
|
||||
## Extension definition: `test.yml`
|
||||
The following example will show the build for:
|
||||
* PHP version: `8.1`
|
||||
* Architecture: `linux/amd64`
|
||||
|
||||
See **[PHP-EXT-test.yml.md](../doc/contributor/PHP-EXT-test.yml.md)** how to alter the `test.yml` file.
|
||||
### Ensure to have `base` flavour
|
||||
|
||||
Either build it yourself for the specific PHP version and architecture.
|
||||
```bash
|
||||
make build STAGE=base VERSION=8.1 ARCH=linux/amd64
|
||||
```
|
||||
Or pull it from Dockerhub
|
||||
```
|
||||
make docker-pull-base-image STAGE=mods VERSION=8.1 ARCH=linux/amd64
|
||||
```
|
||||
|
||||
### Build the `mods` flavour
|
||||
|
||||
This flavour will include the PHP modules you have generated above.
|
||||
```bash
|
||||
make build STAGE=mods VERSION=8.1 ARCH=linux/amd64
|
||||
```
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
@@ -1 +0,0 @@
|
||||
---
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user