Skip to content

NCAR/pantheon-drupal-ci-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pantheon Drupal CI Build

A PHP 8.4.21 CLI Docker image with browser support, Composer, Pantheon Terminus, and Xdebug for local development and CI/CD workflows.

Image Features

  • Base Image: Official php:8.4.21-cli
  • Browser Support:
    • google-chrome-stable on amd64
    • chromium fallback on non-amd64 architectures
  • PHP Tooling: Composer 2 and Xdebug
  • Pantheon Tooling: Terminus 4.3.1
  • Container Working Directory: /app

Building Locally

To build the Docker image locally:

docker build -t pantheon-drupal-ci:latest .

On Apple Silicon, if you specifically want Google Chrome instead of the Chromium fallback, build for amd64:

docker buildx build --platform linux/amd64 -t pantheon-drupal-ci:latest .

Testing the Image

docker run --rm pantheon-drupal-ci:latest php -v
docker run --rm pantheon-drupal-ci:latest composer --version
docker run --rm pantheon-drupal-ci:latest terminus --version
docker run --rm pantheon-drupal-ci:latest php -m | grep -i xdebug
docker run --rm pantheon-drupal-ci:latest google-chrome --version

The php -v output should report PHP 8.4.21.

GitHub Container Registry

This image is automatically built and pushed to GitHub Container Registry (GHCR) on every push to the main branch.

Pulling the Image

docker pull ghcr.io/YOUR_USERNAME/pantheon-drupal-ci-build:latest

CI/CD Workflow

The GitHub Actions workflow (docker-build-push.yml) handles:

  • Building the Docker image on pushes to main and pull requests
  • Pushing to GHCR for pushes to main
  • Automatic tagging with:
    • Branch names
    • Latest tag for main branch
    • Git SHA for traceability
    • Semantic versioning (when using git tags)

Authentication

The workflow uses GITHUB_TOKEN for authentication to GHCR. No additional configuration is needed - GitHub automatically provides this token for actions running in your repository.

Key Directories & Configuration

  • Working Directory: /app
  • Composer Binary: /usr/local/bin/composer
  • Terminus Binary: /usr/local/bin/terminus
  • Xdebug Config: /usr/local/etc/php/conf.d/99-xdebug.ini

Customization

Edit the Dockerfile to add or modify:

  • Additional PHP extensions (via pecl or docker-php-ext-install)
  • Browser packages and architecture handling
  • Terminus version via TERMINUS_VERSION
  • Composer, Xdebug, and other CLI tooling

About

Docker image used by CI tools and local development for Pantheon based Drupal sites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors