DirectorySecurity AdvisoriesPricing
/
Sign in
Directory
drupal logo

drupal

Last changed

Request a free trial

Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.

Tags
Overview
Comparison
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Container for drupal

Drupal is an open source content management platform supporting a variety of websites ranging from personal weblogs to large community-driven websites.

Chainguard Containers are regularly-updated, secure-by-default container images.

Download this Container Image

For those with access, this container image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/drupal:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.

Usage

Running with SQLite (Development)

For quick testing and development, you can run Drupal with the built-in SQLite database:

docker run -d -p 8080:80 cgr.dev/ORGANIZATION/drupal:latest

Then visit http://localhost:8080/core/install.php to complete the installation.

Running with MySQL (Recommended for Production)

For production deployments, MySQL is recommended as it has the best support and widest adoption in the Drupal community.

Docker Compose

First, generate secure passwords:

export MYSQL_PASSWORD=$(openssl rand -base64 32)
export MYSQL_ROOT_PASSWORD=$(openssl rand -base64 32)
echo "MYSQL_PASSWORD: $MYSQL_PASSWORD"
echo "MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD"

Create a docker-compose.yml file:

version: '3.8'
services:
  drupal:
    image: cgr.dev/ORGANIZATION/drupal:latest
    ports:
      - "8080:80"
    depends_on:
      - mysql

  mysql:
    image: cgr.dev/ORGANIZATION/mysql:latest
    environment:
      MYSQL_DATABASE: drupal
      MYSQL_USER: drupal
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
    volumes:
      - mysql_data:/var/lib/mysql

volumes:
  mysql_data:

Start the services:

docker-compose up -d

Visit http://localhost:8080/core/install.php and configure the database connection:

  • Database type: MySQL, MariaDB, Percona Server, or equivalent
  • Database name: drupal
  • Database username: drupal
  • Database password: Use the value of $MYSQL_PASSWORD generated above
  • Host: mysql
Kubernetes with Helm

First, generate secure passwords:

export MYSQL_PASSWORD=$(openssl rand -base64 32)
export MYSQL_ROOT_PASSWORD=$(openssl rand -base64 32)
echo "MYSQL_PASSWORD: $MYSQL_PASSWORD"
echo "MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD"

Deploy MySQL using the Chainguard MySQL Helm chart:

helm install mysql oci://cgr.dev/chainguard/mysql-helm \
  --set auth.database=drupal \
  --set auth.username=drupal \
  --set auth.password="$MYSQL_PASSWORD" \
  --set auth.rootPassword="$MYSQL_ROOT_PASSWORD"

Then deploy Drupal:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: drupal
spec:
  replicas: 1
  selector:
    matchLabels:
      app: drupal
  template:
    metadata:
      labels:
        app: drupal
    spec:
      containers:
        - name: drupal
          image: cgr.dev/ORGANIZATION/drupal:latest
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: drupal
spec:
  selector:
    app: drupal
  ports:
    - port: 80
      targetPort: 80
  type: ClusterIP

During installation, configure the database connection:

  • Host: mysql.default.svc.cluster.local
  • Port: 3306
  • Database: drupal
  • Username: drupal
  • Password: Use the value of $MYSQL_PASSWORD generated above

Running with PostgreSQL

PostgreSQL can also be used as the database backend for production deployments.

Docker Compose

First, generate a secure password:

export POSTGRES_PASSWORD=$(openssl rand -base64 32)
echo "POSTGRES_PASSWORD: $POSTGRES_PASSWORD"

Create a docker-compose.yml file:

version: '3.8'
services:
  drupal:
    image: cgr.dev/ORGANIZATION/drupal:latest
    ports:
      - "8080:80"
    depends_on:
      - postgres

  postgres:
    image: cgr.dev/ORGANIZATION/postgres:latest
    environment:
      POSTGRES_DB: drupal
      POSTGRES_USER: drupal
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  postgres_data:

Start the services:

docker-compose up -d

Visit http://localhost:8080/core/install.php and configure the database connection:

  • Database type: PostgreSQL
  • Database name: drupal
  • Database username: drupal
  • Database password: Use the value of $POSTGRES_PASSWORD generated above
  • Host: postgres
Kubernetes with Helm

First, generate a secure password:

export POSTGRES_PASSWORD=$(openssl rand -base64 32)
echo "POSTGRES_PASSWORD: $POSTGRES_PASSWORD"

Deploy PostgreSQL using the Chainguard PostgreSQL Helm chart:

helm install postgresql oci://cgr.dev/chainguard/postgresql-helm \
  --set auth.database=drupal \
  --set auth.username=drupal \
  --set auth.password="$POSTGRES_PASSWORD"

Then deploy Drupal:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: drupal
spec:
  replicas: 1
  selector:
    matchLabels:
      app: drupal
  template:
    metadata:
      labels:
        app: drupal
    spec:
      containers:
        - name: drupal
          image: cgr.dev/ORGANIZATION/drupal:latest
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: drupal
spec:
  selector:
    app: drupal
  ports:
    - port: 80
      targetPort: 80
  type: ClusterIP

During installation, configure the database connection:

  • Host: postgresql.default.svc.cluster.local
  • Port: 5432
  • Database: drupal
  • Username: drupal
  • Password: Use the value of $POSTGRES_PASSWORD generated above

Persistent Storage

For production, mount a persistent volume to /var/www/html/sites to preserve uploaded files and site configuration:

docker run -d -p 8080:80 \
  -v drupal_sites:/var/www/html/sites \
  cgr.dev/ORGANIZATION/drupal:latest

What are Chainguard Containers?

Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.

All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.

The main features of Chainguard Containers include:

For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev, variant.

In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.

Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.

Need additional packages?

To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.

To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.

Learn More

Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Librariescontact us for access.

Trademarks

This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.

Licenses

Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:

  • Apache-2.0

  • Artistic-1.0-Perl

  • BSD-1-Clause

  • BSD-2-Clause

  • BSD-3-Clause

  • BSD-4-Clause-UC

  • Beerware

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Compliance

Chainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.

SLSA compliance at Chainguard

This image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.

PCI DSS at Chainguard

Category
Application

The trusted source for open source

Talk to an expert
© 2025 Chainguard. All Rights Reserved.
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsIntegrationsPricing