PHP-CLI#
The Lagoon php-cli Docker image. Based on Lagoon php-fpm image, it has all the needed command line tools for daily operations.
Containers (or pods) started from cli images are responsible for building code for Composer or Node.js based projects.
The image also contains database clis for both MariaDB and PostgreSQL.
Info
This Dockerfile is intended to be used as a base for any cli needs within Lagoon.
Supported versions#
- 7.3 (available for compatibility only, no longer officially supported) -
uselagoon/php-7.3-cli - 7.4 (available for compatibility only, no longer officially supported) -
uselagoon/php-7.4-cli - 8.0 (available for compatibility only, no longer officially supported) -
uselagoon/php-8.0-cli - 8.1 Dockerfile (Security Support until December 2025) -
uselagoon/php-8.1-cli - 8.2 Dockerfile (Security Support until December 2026) -
uselagoon/php-8.2-cli - 8.3 Dockerfile (Security Support until December 2027) -
uselagoon/php-8.3-cli - 8.4 Dockerfile (Security Support until December 2028) -
uselagoon/php-8.4-cli
All PHP versions use their own Dockerfiles.
Lagoon adaptions#
This image is prepared to be used on Lagoon. There are therefore some things already done:
- Folder permissions are automatically adapted with
fix-permissions, so this image will work with a random user. COMPOSER_ALLOW_SUPERUSER=1removes warning about use of Composer as root.80-shell-timeout.shscript checks if containers are running in a Kubernetes environment and then set a 10 minutes timeout to idleclipods.clicontainers use an SSH key injected by Lagoon or defined intoSSH_PRIVATE_KEYenvironment variable.
Included CLI tools#
The included CLI tools are:
composerversion 1.9.0 (changeable viaCOMPOSER_VERSIONandCOMPOSER_HASH_SHA256)node.jsverison 17 (as of Mar 2022)npmyarnmariadb-clientpostgresql-client
Change Node.js Version#
By default this image ships with the nodejs-current package (v17 as of Mar 2022). If you need another version you can remove the current version and install the one of your choice. For example, to install Node.js 16, modify your dockerfile to include:
Environment variables#
Some options are configurable via environment variables. The php-fpm environment variables also apply.
| Name | Default | Description |
|---|---|---|
| MARIADB_MAX_ALLOWED_PACKET | 64M | Controls the max allowed packet for the MySql client. |