diff --git a/.github/scripts/docker-tags.sh b/.github/scripts/docker-tags.sh index 9631c143..1cc2f9ee 100755 --- a/.github/scripts/docker-tags.sh +++ b/.github/scripts/docker-tags.sh @@ -35,7 +35,7 @@ set_output() { # Print with new lines for output in build logs (IFS=$'\n'; echo "${outputArr[*]}") # Using newlines in output variables does not seem to work, so we'll use comas - (IFS=$','; echo "::set-output name=tags::${outputArr[*]}") + (IFS=$','; echo tags="${outputArr[*]}" | tee -a ${GITHUB_OUTPUT}) } # Image tags diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index 06568ac8..14cd9900 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -1,15 +1,15 @@ -name: Docker Build and Push +name: Build, Test, Push on: schedule: - - cron: '0 10 * * 0' # Every Sunday at 10AM + - cron: "0 10 * * 0" # Every Sunday at 10AM push: branches: - master - develop - feature/* tags: - - 'v*.*.*' + - "v*.*.*" workflow_dispatch: # Allow manually triggering a build defaults: @@ -19,7 +19,7 @@ defaults: env: IMAGE: docksal/cli UPSTREAM_IMAGE: debian - LATEST_VERSION: '8.2' + LATEST_VERSION: "8.3" DOCKSAL_VERSION: develop jobs: @@ -34,27 +34,27 @@ jobs: - platform: linux/amd64 arch: amd64 - version: '8.1' + version: "8.1" - platform: linux/amd64 arch: amd64 - version: '8.2' + version: "8.2" - platform: linux/amd64 arch: amd64 - version: '8.3' + version: "8.3" - platform: linux/arm64 arch: arm64 - version: '8.1' + version: "8.1" - platform: linux/arm64 arch: arm64 - version: '8.2' + version: "8.2" - platform: linux/arm64 arch: arm64 - version: '8.3' + version: "8.3" env: ARCH: ${{ matrix.arch }} @@ -76,9 +76,10 @@ jobs: echo ARM64_HOST_SSH_CERT="$(ssh-keyscan -t rsa ${{ secrets.ARM64_HOST }} 2>/dev/null)" | tee -a ${GITHUB_ENV} - # Switch docker context to a remote arm64 host + # Used for building heavy images that take too long to build using QEMU + for native arm64 testing. name: Switch to arm64 builder host if: ${{ env.ARCH == 'arm64' }} - uses: arwynfr/actions-docker-context@v2 + uses: docksal/actions/docker-context@main with: docker_host: "ssh://build-agent@${{ secrets.ARM64_HOST }}" context_name: arm64-host @@ -123,27 +124,27 @@ jobs: - platform: linux/amd64 arch: amd64 - version: '8.1' + version: "8.1" - platform: linux/amd64 arch: amd64 - version: '8.2' + version: "8.2" - platform: linux/amd64 arch: amd64 - version: '8.3' + version: "8.3" - platform: linux/arm64 arch: arm64 - version: '8.1' + version: "8.1" - platform: linux/arm64 arch: arm64 - version: '8.2' + version: "8.2" - platform: linux/arm64 arch: arm64 - version: '8.3' + version: "8.3" env: ARCH: ${{ matrix.arch }} @@ -153,9 +154,7 @@ jobs: steps: - name: Setup Bats - uses: mig4/setup-bats@v1 - with: - bats-version: '1.3.0' + uses: bats-core/bats-action@2.0.0 - name: Checkout uses: actions/checkout@v4 @@ -170,9 +169,10 @@ jobs: echo ARM64_HOST_SSH_CERT="$(ssh-keyscan -t rsa ${{ secrets.ARM64_HOST }} 2>/dev/null)" | tee -a ${GITHUB_ENV} - # Switch docker context to a remote arm64 host + # Used for building heavy images that take too long to build using QEMU + for native arm64 testing. name: Switch to arm64 builder host if: ${{ env.ARCH == 'arm64' }} - uses: arwynfr/actions-docker-context@v2 + uses: docksal/actions/docker-context@main with: docker_host: "ssh://build-agent@${{ secrets.ARM64_HOST }}" context_name: arm64-host @@ -219,9 +219,9 @@ jobs: strategy: matrix: version: - - '8.1' - - '8.2' - - '8.3' + - "8.1" + - "8.2" + - "8.3" env: VERSION_PREFIX: php diff --git a/8.1/Dockerfile b/8.1/Dockerfile index a31a0102..7d1cf6dd 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1.27-fpm-bookworm as cli +FROM php:8.1.28-fpm-bookworm as cli ARG TARGETARCH ARG DEBIAN_FRONTEND=noninteractive @@ -240,16 +240,16 @@ RUN set -xe; \ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.27 \ - COMPOSER2_VERSION=2.7.0 \ + COMPOSER2_VERSION=2.7.2 \ DRUSH_VERSION=8.4.12 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ - WPCLI_VERSION=2.9.0 \ + WPCLI_VERSION=2.10.0 \ # platformsh/legacy-cli - PLATFORMSH_CLI_VERSION=4.14.1 \ - ACQUIA_CLI_VERSION=2.22.1 \ - TERMINUS_VERSION=3.3.3 \ + PLATFORMSH_CLI_VERSION=4.18.0 \ + ACQUIA_CLI_VERSION=2.25.0 \ + TERMINUS_VERSION=3.3.5 \ JQ_VERSION=1.7.1 \ - YQ_VERSION=4.40.5 + YQ_VERSION=4.43.1 RUN set -xe; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ @@ -326,9 +326,10 @@ $HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibil # Node.js (installed as user) ENV \ NVM_VERSION=0.39.7 \ - NODE_VERSION=20.11.0 \ - # yarn releases above 1.22.19 don't install - YARN_VERSION=1.22.19 + NODE_VERSION=20.12.2 \ + # Yarn (Classic v1) + # https://github.com/yarnpkg/yarn/releases + YARN_VERSION=1.22.22 # Don't use -x here, as the output may be excessive RUN set -e; \ # NVM and a defaut Node.js version @@ -336,9 +337,11 @@ RUN set -e; \ curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash >/dev/null; \ # Reload profile to load nvm (needed by Yarn installation below) . $HOME/.profile; \ - # Yarn - export YARN_PROFILE="$HOME/.profile"; \ - curl -fsSL https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION} >/dev/null + # Yarn (Classic v1) + # Installing via npm to allow fore override with never versions via corepack + npm install -g yarn@${YARN_VERSION}; \ + # Enable corepack (allows installing project level yarn v2+ via yarn) + corepack enable ## Ruby bundler ## Don't use -x here, as the output may be excessive @@ -414,8 +417,8 @@ USER docker ARG HOME=/home/docker ENV \ - CODE_SERVER_VERSION=4.20.1 \ - VSCODE_GITLENS_VERSION=14.7.0 \ + CODE_SERVER_VERSION=4.23.1 \ + VSCODE_GITLENS_VERSION=14.9.0 \ VSCODE_XDEBUG_VERSION=1.34.0 \ VSCODE_HOME="${HOME}/code-server" diff --git a/8.1/config/php/zz-php-fpm.conf b/8.1/config/php/zz-php-fpm.conf index d4fb5e22..f045760d 100644 --- a/8.1/config/php/zz-php-fpm.conf +++ b/8.1/config/php/zz-php-fpm.conf @@ -3,12 +3,16 @@ [global] ; This pid file is used for Docker healthcheck pid = /run/php-fpm.pid +; Reduce noise in logs +log_level = error [www] user = docker catch_workers_output = yes listen = 0.0.0.0:9000 clear_env = no +; Do not log php-fpm accesses (see web container for http access) +access.log = /dev/null ; PHP (FPM) settings ; See zz-php.ini for global (CLI and FPM) PHP settings diff --git a/8.1/config/supervisor/supervisord.conf b/8.1/config/supervisor/supervisord.conf index 32c7217a..05e9e01e 100644 --- a/8.1/config/supervisor/supervisord.conf +++ b/8.1/config/supervisor/supervisord.conf @@ -4,3 +4,9 @@ nodaemon = true # This way logs can be reviewed with docker logs. # Additionalluy, logs from specific services are forwarded to individual files on disk. loglevel = debug +# Mute the "CRIT Supervisor is running as root" warning in logs. +user=root +# Mute the "CRIT Server 'unix_http_server' running without any HTTP authentication checking" warning in logs +[unix_http_server] +username = dummy +password = dummy diff --git a/8.2/Dockerfile b/8.2/Dockerfile index b8be9313..6cc9449b 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.15-fpm-bookworm as cli +FROM php:8.2.18-fpm-bookworm as cli ARG TARGETARCH ARG DEBIAN_FRONTEND=noninteractive @@ -241,16 +241,16 @@ RUN set -xe; \ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.27 \ - COMPOSER2_VERSION=2.7.0 \ + COMPOSER2_VERSION=2.7.2 \ DRUSH_VERSION=8.4.12 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ - WPCLI_VERSION=2.9.0 \ + WPCLI_VERSION=2.10.0 \ # platformsh/legacy-cli - PLATFORMSH_CLI_VERSION=4.14.1 \ - ACQUIA_CLI_VERSION=2.22.1 \ - TERMINUS_VERSION=3.3.3 \ + PLATFORMSH_CLI_VERSION=4.18.0 \ + ACQUIA_CLI_VERSION=2.25.0 \ + TERMINUS_VERSION=3.3.5 \ JQ_VERSION=1.7.1 \ - YQ_VERSION=4.40.5 + YQ_VERSION=4.43.1 RUN set -xe; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ @@ -327,9 +327,10 @@ $HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibil # Node.js (installed as user) ENV \ NVM_VERSION=0.39.7 \ - NODE_VERSION=20.11.0 \ - # yarn releases above 1.22.19 don't install - YARN_VERSION=1.22.19 + NODE_VERSION=20.12.2 \ + # Yarn (Classic v1) + # https://github.com/yarnpkg/yarn/releases + YARN_VERSION=1.22.22 # Don't use -x here, as the output may be excessive RUN set -e; \ # NVM and a defaut Node.js version @@ -337,9 +338,11 @@ RUN set -e; \ curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash >/dev/null; \ # Reload profile to load nvm (needed by Yarn installation below) . $HOME/.profile; \ - # Yarn - export YARN_PROFILE="$HOME/.profile"; \ - curl -fsSL https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION} >/dev/null + # Yarn (Classic v1) + # Installing via npm to allow fore override with never versions via corepack + npm install -g yarn@${YARN_VERSION}; \ + # Enable corepack (allows installing project level yarn v2+ via yarn) + corepack enable ## Ruby bundler ## Don't use -x here, as the output may be excessive @@ -415,8 +418,8 @@ USER docker ARG HOME=/home/docker ENV \ - CODE_SERVER_VERSION=4.20.1 \ - VSCODE_GITLENS_VERSION=14.7.0 \ + CODE_SERVER_VERSION=4.23.1 \ + VSCODE_GITLENS_VERSION=14.9.0 \ VSCODE_XDEBUG_VERSION=1.34.0 \ VSCODE_HOME="${HOME}/code-server" diff --git a/8.2/config/php/zz-php-fpm.conf b/8.2/config/php/zz-php-fpm.conf index d4fb5e22..f045760d 100644 --- a/8.2/config/php/zz-php-fpm.conf +++ b/8.2/config/php/zz-php-fpm.conf @@ -3,12 +3,16 @@ [global] ; This pid file is used for Docker healthcheck pid = /run/php-fpm.pid +; Reduce noise in logs +log_level = error [www] user = docker catch_workers_output = yes listen = 0.0.0.0:9000 clear_env = no +; Do not log php-fpm accesses (see web container for http access) +access.log = /dev/null ; PHP (FPM) settings ; See zz-php.ini for global (CLI and FPM) PHP settings diff --git a/8.2/config/supervisor/supervisord.conf b/8.2/config/supervisor/supervisord.conf index 32c7217a..05e9e01e 100644 --- a/8.2/config/supervisor/supervisord.conf +++ b/8.2/config/supervisor/supervisord.conf @@ -4,3 +4,9 @@ nodaemon = true # This way logs can be reviewed with docker logs. # Additionalluy, logs from specific services are forwarded to individual files on disk. loglevel = debug +# Mute the "CRIT Supervisor is running as root" warning in logs. +user=root +# Mute the "CRIT Server 'unix_http_server' running without any HTTP authentication checking" warning in logs +[unix_http_server] +username = dummy +password = dummy diff --git a/8.3/Dockerfile b/8.3/Dockerfile index 42c529f0..8e5826f8 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.2-fpm-bookworm as cli +FROM php:8.3.6-fpm-bookworm as cli ARG TARGETARCH ARG DEBIAN_FRONTEND=noninteractive @@ -250,16 +250,16 @@ RUN set -xe; \ ENV \ COMPOSER_DEFAULT_VERSION=2 \ COMPOSER_VERSION=1.10.27 \ - COMPOSER2_VERSION=2.7.0 \ + COMPOSER2_VERSION=2.7.2 \ DRUSH_VERSION=8.4.12 \ DRUPAL_CONSOLE_LAUNCHER_VERSION=1.9.7 \ - WPCLI_VERSION=2.9.0 \ + WPCLI_VERSION=2.10.0 \ # platformsh/legacy-cli - PLATFORMSH_CLI_VERSION=4.14.1 \ - ACQUIA_CLI_VERSION=2.22.1 \ - TERMINUS_VERSION=3.3.3 \ + PLATFORMSH_CLI_VERSION=4.18.0 \ + ACQUIA_CLI_VERSION=2.25.0 \ + TERMINUS_VERSION=3.3.5 \ JQ_VERSION=1.7.1 \ - YQ_VERSION=4.40.5 + YQ_VERSION=4.43.1 RUN set -xe; \ # Composer 1.x curl -fsSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer1; \ @@ -336,9 +336,10 @@ $HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibil # Node.js (installed as user) ENV \ NVM_VERSION=0.39.7 \ - NODE_VERSION=20.11.0 \ - # yarn releases above 1.22.19 don't install - YARN_VERSION=1.22.19 + NODE_VERSION=20.12.2 \ + # Yarn (Classic v1) + # https://github.com/yarnpkg/yarn/releases + YARN_VERSION=1.22.22 # Don't use -x here, as the output may be excessive RUN set -e; \ # NVM and a defaut Node.js version @@ -346,9 +347,11 @@ RUN set -e; \ curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash >/dev/null; \ # Reload profile to load nvm (needed by Yarn installation below) . $HOME/.profile; \ - # Yarn - export YARN_PROFILE="$HOME/.profile"; \ - curl -fsSL https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION} >/dev/null + # Yarn (Classic v1) + # Installing via npm to allow fore override with never versions via corepack + npm install -g yarn@${YARN_VERSION}; \ + # Enable corepack (allows installing project level yarn v2+ via yarn) + corepack enable ## Ruby bundler ## Don't use -x here, as the output may be excessive @@ -424,8 +427,8 @@ USER docker ARG HOME=/home/docker ENV \ - CODE_SERVER_VERSION=4.20.1 \ - VSCODE_GITLENS_VERSION=14.7.0 \ + CODE_SERVER_VERSION=4.23.1 \ + VSCODE_GITLENS_VERSION=14.9.0 \ VSCODE_XDEBUG_VERSION=1.34.0 \ VSCODE_HOME="${HOME}/code-server" diff --git a/8.3/config/php/zz-php-fpm.conf b/8.3/config/php/zz-php-fpm.conf index d4fb5e22..f045760d 100644 --- a/8.3/config/php/zz-php-fpm.conf +++ b/8.3/config/php/zz-php-fpm.conf @@ -3,12 +3,16 @@ [global] ; This pid file is used for Docker healthcheck pid = /run/php-fpm.pid +; Reduce noise in logs +log_level = error [www] user = docker catch_workers_output = yes listen = 0.0.0.0:9000 clear_env = no +; Do not log php-fpm accesses (see web container for http access) +access.log = /dev/null ; PHP (FPM) settings ; See zz-php.ini for global (CLI and FPM) PHP settings diff --git a/8.3/config/supervisor/supervisord.conf b/8.3/config/supervisor/supervisord.conf index 32c7217a..05e9e01e 100644 --- a/8.3/config/supervisor/supervisord.conf +++ b/8.3/config/supervisor/supervisord.conf @@ -4,3 +4,9 @@ nodaemon = true # This way logs can be reviewed with docker logs. # Additionalluy, logs from specific services are forwarded to individual files on disk. loglevel = debug +# Mute the "CRIT Supervisor is running as root" warning in logs. +user=root +# Mute the "CRIT Server 'unix_http_server' running without any HTTP authentication checking" warning in logs +[unix_http_server] +username = dummy +password = dummy diff --git a/README.md b/README.md index 20277287..3f99cc7e 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,9 @@ This image focuses on console tools necessary to develop LAMP stack (and other w This image(s) is part of the [Docksal](https://docksal.io) image library. - ## Features -- Based on the official php-fpm Debian 11 (bullseye) images +- Based on the official php-fpm Debian 12 (bookworm) images - php/php-fpm (w/ xdebug), nodejs (via nvm), python, ruby - Framework specific tools for Drupal and Wordpress - Miscellaneous cli tools for day to day web development @@ -17,23 +16,16 @@ This image(s) is part of the [Docksal](https://docksal.io) image library. - [VS Code Server](https://github.com/cdr/code-server) (VS Code in the browser) - Multi-platform images (amd64/arm64) starting with v3.0.0 - ## Versions and image tag naming convention -- Stable versions v3 (amd64/arm64) - - `php8.0-3.0`, `php8.0`, `php8.0` - PHP 8.0 - - `php8.1-3.0`, `php8.1`, `php8.1`, `latest` - PHP 8.1 -- Development versions (amd64/arm64) - - `php8.0-edge` - PHP 8.0 - - `php8.1-edge` - PHP 8.0 -- Legacy versions v3 (amd64/arm64) - - `php7.3-3.0`, `php7.3-2`, `php7.3` - PHP 7.3 - - `php7.4-3.3`, `php7.4-3`, `php7.4` - PHP 7.4 -- Legacy versions v2 (amd64) - - `php7.3-2.13`, `php7.3-2`, `php7.3` - PHP 7.3 - - `php7.4-2.13`, `php7.4-2`, `php7.4` - PHP 7.4 - - `php8.0-2.13`, `php8.0`, `php8.0` - PHP 8.0 - +- Stable versions v3 + - `php8.1-3.8`, `php8.1` - PHP 8.1 + - `php8.2-3.8`, `php8.2` - PHP 8.2 + - `php8.3-3.8`, `php8.3`, `latest` - PHP 8.3 +- Development versions + - `php8.1-edge` - PHP 8.1 + - `php8.2-edge` - PHP 8.2 + - `php8.3-edge` - PHP 8.3 ## PHP @@ -54,8 +46,7 @@ manner (installing them with `apt-get` won't work). - SQLite - via `sqlite3`, `pdo_sqlite` - MySQL - via `mysqli`, `mysqlnd`, `pdo_mysql` - PostgreSQL - via `pgsql`, `pdo_pgsql` -- MSSQL - via `sqlsrv` and `pdo_sqlsrv` (amd64 only) - +- MSSQL - via `sqlsrv` and `pdo_sqlsrv` ### Using PHP Xdebug @@ -74,17 +65,16 @@ cli [See docs](https://docs.docksal.io/tools/xdebug/) on using Xdebug for web and cli PHP debugging. - ## NodeJS - nvm -- node v14.17.3 (following NodeJS LTS release cycle) -- yarn +- node v20.12.2 (following NodeJS LTS release cycle) +- yarn (classic v1) NodeJS is installed via `nvm` in the `docker` user's profile inside the image (`/home/docker/.nvm`). -If you need a different version of node, use `nvm` to install it, e.g., `nvm install 11.6.0`. -Then, use `nvm use 11.6.0` to use it in the current session or `nvm alias default 11.6.0` to use it by default. +If you need a different version of node, use `nvm` to install it, e.g., `nvm install 21.7.3`. +Then, use `nvm use 21.7.3` to use it in the current session or `nvm alias default 21.7.3` to use it by default. ## Python @@ -103,7 +93,6 @@ This image comes with a system level installed Ruby v2.7.x from upstream Debian - mysql, pgsql, and sqlsrv cli clients - imagemagick, ghostscript - mc, nano, rsync -- mhsendmail - cron ## Hosting provider tools @@ -114,14 +103,12 @@ This image comes with a system level installed Ruby v2.7.x from upstream Debian Also, see the [Secrets](#secrets) section below for more information on managing and using your hosting provider keys. - ## Customizing startup To run a custom startup script anytime the `cli` container has started, create a `startup.sh` file within the `.docksal/services/cli` directory. Additionally, make sure that the file is executable as well so that the container does not run into issues when attempting to execute the file. - ## Scheduling cron jobs Cron can be configured by making sure there is a `crontab` file located within `.docksal/services/cli`. The file should @@ -188,7 +175,6 @@ GIT_USER_EMAIL="git@example.com" GIT_USER_NAME="Docksal CLI" ``` - ## Coder (Visual Studio Code web IDE) diff --git a/tests/test.bats b/tests/test.bats index 049fce25..3aaf5670 100755 --- a/tests/test.bats +++ b/tests/test.bats @@ -359,7 +359,7 @@ _healthcheck_wait () unset output # Confirm authentication works - run docker exec -u docker "${NAME}" bash -lc 'platform auth:info -n' + run docker exec -u docker "${NAME}" bash -lc 'platform auth:info --no-interaction' [[ ${status} == 0 ]] [[ ! "${output}" =~ "Invalid API token" ]] [[ "${output}" =~ "developer@docksal.io" ]]