├── 10 ├── bin │ ├── actions.mk │ ├── get_drupal_version │ └── init ├── init │ └── 20-drupal.sh ├── tests │ └── run.sh ├── templates │ └── settings.php.tmpl ├── Dockerfile └── Makefile ├── 11 ├── bin │ ├── actions.mk │ ├── get_drupal_version │ └── init ├── init │ └── 20-drupal.sh ├── tests │ └── run.sh ├── templates │ └── settings.php.tmpl ├── Dockerfile └── Makefile ├── .gitignore ├── .drupal-php ├── LICENSE.md ├── .github ├── actions │ ├── action.yml │ └── release.sh └── workflows │ └── workflow.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /10/bin/actions.mk: -------------------------------------------------------------------------------- 1 | -include /usr/local/bin/drupal-php.mk 2 | 3 | .PHONY: init 4 | 5 | init: 6 | @sudo -E init 7 | -------------------------------------------------------------------------------- /11/bin/actions.mk: -------------------------------------------------------------------------------- 1 | -include /usr/local/bin/drupal-php.mk 2 | 3 | .PHONY: init 4 | 5 | init: 6 | @sudo -E init 7 | -------------------------------------------------------------------------------- /.drupal-php: -------------------------------------------------------------------------------- 1 | 8.5#2025-12-22T03:29:36.376217Z 2 | 8.4#2025-12-22T03:29:36.376217Z 3 | 8.3#2025-12-22T03:29:36.376217Z 4 | 8.2#2025-12-22T03:29:36.376217Z 5 | 8.1#2025-12-22T03:29:36.376217Z -------------------------------------------------------------------------------- /10/init/20-drupal.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | if [[ -z "${WODBY_APP_NAME}" ]]; then 10 | make init -f /usr/local/bin/actions.mk 11 | fi -------------------------------------------------------------------------------- /11/init/20-drupal.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | if [[ -z "${WODBY_APP_NAME}" ]]; then 10 | make init -f /usr/local/bin/actions.mk 11 | fi -------------------------------------------------------------------------------- /10/bin/get_drupal_version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | drupal_root=$1 10 | 11 | if [[ -z "${drupal_root}" ]]; then 12 | drupal_root="${APP_ROOT}/web" 13 | fi 14 | 15 | drush status --fields=drupal-version -r "${drupal_root}" | grep -oE '[0-9]+(\.[0-9]+){1,2}' -------------------------------------------------------------------------------- /11/bin/get_drupal_version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | drupal_root=$1 10 | 11 | if [[ -z "${drupal_root}" ]]; then 12 | drupal_root="${APP_ROOT}/web" 13 | fi 14 | 15 | drush status --fields=drupal-version -r "${drupal_root}" | grep -oE '[0-9]+(\.[0-9]+){1,2}' -------------------------------------------------------------------------------- /10/tests/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | cid="$( 10 | docker run -d -e WODBY_APP_NAME=Test "${IMAGE}" 11 | )" 12 | trap "docker rm -vf ${cid} > /dev/null" EXIT 13 | 14 | docker exec "${cid}" make init -f /usr/local/bin/actions.mk 15 | echo -n "Checking Drupal version... " 16 | docker exec "${cid}" drush -r "/var/www/html/web" status | grep -q 'Drupal root' 17 | echo "OK" 18 | -------------------------------------------------------------------------------- /11/tests/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | cid="$( 10 | docker run -d -e WODBY_APP_NAME=Test "${IMAGE}" 11 | )" 12 | trap "docker rm -vf ${cid} > /dev/null" EXIT 13 | 14 | docker exec "${cid}" make init -f /usr/local/bin/actions.mk 15 | echo -n "Checking Drupal version... " 16 | docker exec "${cid}" drush -r "/var/www/html/web" status | grep -q 'Drupal root' 17 | echo "OK" 18 | -------------------------------------------------------------------------------- /10/templates/settings.php.tmpl: -------------------------------------------------------------------------------- 1 | $databases['default']['default'] = [ 2 | 'host' => '{{ getenv "DB_HOST" "mariadb" }}', 3 | 'database' => '{{ getenv "DB_NAME" "drupal" }}', 4 | 'username' => '{{ getenv "DB_USER" "drupal" }}', 5 | 'password' => '{{ getenv "DB_PASSWORD" "drupal" }}', 6 | 'driver' => '{{ getenv "DB_DRIVER" "mysql" }}', 7 | 'prefix' => '{{ getenv "DB_PREFIX" }}', 8 | ]; 9 | 10 | $settings['config_sync_directory'] = '{{ getenv "FILES_DIR" }}/config/sync_dir'; 11 | $settings['hash_salt'] = '{{ getenv "DRUPAL_HASH_SALT" "very-bad-salt" }}'; 12 | 13 | $settings['trusted_host_patterns'] = array( 14 | {{ getenv "DRUPAL_TRUSTED_HOST_PATTERNS" "'\\.localhost$', '\\.local$', '\\.loc$'" }} 15 | ); -------------------------------------------------------------------------------- /11/templates/settings.php.tmpl: -------------------------------------------------------------------------------- 1 | $databases['default']['default'] = [ 2 | 'host' => '{{ getenv "DB_HOST" "mariadb" }}', 3 | 'database' => '{{ getenv "DB_NAME" "drupal" }}', 4 | 'username' => '{{ getenv "DB_USER" "drupal" }}', 5 | 'password' => '{{ getenv "DB_PASSWORD" "drupal" }}', 6 | 'driver' => '{{ getenv "DB_DRIVER" "mysql" }}', 7 | 'prefix' => '{{ getenv "DB_PREFIX" }}', 8 | ]; 9 | 10 | $settings['config_sync_directory'] = '{{ getenv "FILES_DIR" }}/config/sync_dir'; 11 | $settings['hash_salt'] = '{{ getenv "DRUPAL_HASH_SALT" "very-bad-salt" }}'; 12 | 13 | $settings['trusted_host_patterns'] = array( 14 | {{ getenv "DRUPAL_TRUSTED_HOST_PATTERNS" "'\\.localhost$', '\\.local$', '\\.loc$'" }} 15 | ); -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Wodby, Inc. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /.github/actions/action.yml: -------------------------------------------------------------------------------- 1 | name: push 2 | description: combine multi-arch image and push 3 | inputs: 4 | version: 5 | description: version 6 | required: true 7 | php: 8 | description: php version 9 | required: true 10 | workdir: 11 | description: workdir 12 | required: true 13 | latest: 14 | description: if tag latest 15 | required: false 16 | latest_major: 17 | description: if tag latest major version 18 | required: false 19 | latest_php: 20 | description: if provided php version is latest 21 | required: false 22 | latest_major_php: 23 | description: if provided php version is latest major 24 | required: false 25 | runs: 26 | using: "composite" 27 | steps: 28 | - name: Build image 29 | env: 30 | DRUPAL_VER: ${{ inputs.version }} 31 | PHP_VER: ${{ inputs.php }} 32 | LATEST: ${{ inputs.latest }} 33 | LATEST_MAJOR: ${{ inputs.latest_major }} 34 | LATEST_PHP: ${{ inputs.latest_php }} 35 | LATEST_MAJOR_PHP: ${{ inputs.latest_major_php }} 36 | run: | 37 | . $GITHUB_ACTION_PATH/release.sh 38 | shell: bash 39 | working-directory: ${{ inputs.workdir }} 40 | -------------------------------------------------------------------------------- /10/bin/init: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | src_dir="/usr/src/drupal" 10 | 11 | if [[ ! -f "${APP_ROOT}/web/index.php" ]]; then 12 | echo "${APP_NAME} not found in ${APP_ROOT} - copying now..." 13 | rsync -a "${src_dir}/" "${APP_ROOT}/" 14 | echo "Complete! ${APP_NAME} has been successfully copied to ${APP_ROOT}" 15 | 16 | if [[ -z "${WODBY_APP_NAME}" ]]; then 17 | hash_salt=$(openssl rand -base64 12) 18 | export DRUPAL_HASH_SALT="${hash_salt}" 19 | su-exec www-data mkdir -p "${FILES_DIR}/config/sync_dir" 20 | su-exec wodby gotpl /etc/gotpl/settings.php.tmpl >> "${APP_ROOT}/web/sites/default/settings.php" 21 | fi 22 | else 23 | latest_ver=$(su-exec wodby get_drupal_version "${src_dir}/web") 24 | current_ver=$(su-exec wodby get_drupal_version "${APP_ROOT}/web") 25 | 26 | res=$(compare_semver "${latest_ver}" "${current_ver}" ">") 27 | 28 | if [[ "${res}" == 0 ]]; then 29 | echo "Current version of ${APP_NAME} is outdated (${current_ver}), updating to ${latest_ver}..." 30 | rsync -a "${src_dir}/" "${APP_ROOT}/" 31 | echo "Complete! ${APP_NAME} has been successfully updated to ${latest_ver}" 32 | fi 33 | fi 34 | -------------------------------------------------------------------------------- /11/bin/init: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | src_dir="/usr/src/drupal" 10 | 11 | if [[ ! -f "${APP_ROOT}/web/index.php" ]]; then 12 | echo "${APP_NAME} not found in ${APP_ROOT} - copying now..." 13 | rsync -a "${src_dir}/" "${APP_ROOT}/" 14 | echo "Complete! ${APP_NAME} has been successfully copied to ${APP_ROOT}" 15 | 16 | if [[ -z "${WODBY_APP_NAME}" ]]; then 17 | hash_salt=$(openssl rand -base64 12) 18 | export DRUPAL_HASH_SALT="${hash_salt}" 19 | su-exec www-data mkdir -p "${FILES_DIR}/config/sync_dir" 20 | su-exec wodby gotpl /etc/gotpl/settings.php.tmpl >> "${APP_ROOT}/web/sites/default/settings.php" 21 | fi 22 | else 23 | latest_ver=$(su-exec wodby get_drupal_version "${src_dir}/web") 24 | current_ver=$(su-exec wodby get_drupal_version "${APP_ROOT}/web") 25 | 26 | res=$(compare_semver "${latest_ver}" "${current_ver}" ">") 27 | 28 | if [[ "${res}" == 0 ]]; then 29 | echo "Current version of ${APP_NAME} is outdated (${current_ver}), updating to ${latest_ver}..." 30 | rsync -a "${src_dir}/" "${APP_ROOT}/" 31 | echo "Complete! ${APP_NAME} has been successfully updated to ${latest_ver}" 32 | fi 33 | fi 34 | -------------------------------------------------------------------------------- /10/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE_TAG 2 | 3 | FROM wodby/drupal-php:${BASE_IMAGE_TAG} 4 | 5 | ARG DRUPAL_VER 6 | 7 | ENV DRUPAL_VER="${DRUPAL_VER}" \ 8 | DOCROOT_SUBDIR="web" \ 9 | APP_NAME="Drupal 10" 10 | 11 | USER root 12 | 13 | RUN set -ex; \ 14 | \ 15 | mv /usr/local/bin/actions.mk /usr/local/bin/drupal-php.mk; \ 16 | mkdir -p /usr/src/drupal; \ 17 | chown wodby:wodby -R /usr/src; \ 18 | \ 19 | COMPOSER_MEMORY_LIMIT=-1 su-exec wodby composer create-project "drupal/recommended-project:${DRUPAL_VER}" /usr/src/drupal --no-interaction; \ 20 | \ 21 | cd /usr/src/drupal; \ 22 | cp web/sites/default/default.settings.php web/sites/default/settings.php; \ 23 | mkdir -p web/sites/default/files; \ 24 | chmod 777 web/sites/default/files; \ 25 | chown wodby:wodby web/sites/default/settings.php web/sites/default/files; \ 26 | su-exec wodby composer require drush/drush; \ 27 | # @todo install console, currently in conflict https://github.com/hechoendrupal/drupal-console/issues/4220 28 | #su-exec wodby composer require --dev drupal/console:@stable; \ 29 | \ 30 | if [[ -z "${PHP_DEV}" ]]; then \ 31 | echo "$(cat /etc/sudoers.d/wodby), /usr/local/bin/init" > /etc/sudoers.d/wodby; \ 32 | fi; \ 33 | \ 34 | su-exec wodby composer clear-cache 35 | 36 | USER wodby 37 | 38 | COPY templates/settings.php.tmpl /etc/gotpl/ 39 | COPY init /docker-entrypoint-init.d/ 40 | COPY bin /usr/local/bin/ -------------------------------------------------------------------------------- /11/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE_TAG 2 | 3 | FROM wodby/drupal-php:${BASE_IMAGE_TAG} 4 | 5 | ARG DRUPAL_VER 6 | 7 | ENV DRUPAL_VER="${DRUPAL_VER}" \ 8 | DOCROOT_SUBDIR="web" \ 9 | APP_NAME="Drupal 11" 10 | 11 | USER root 12 | 13 | RUN set -ex; \ 14 | \ 15 | mv /usr/local/bin/actions.mk /usr/local/bin/drupal-php.mk; \ 16 | mkdir -p /usr/src/drupal; \ 17 | chown wodby:wodby -R /usr/src; \ 18 | \ 19 | COMPOSER_MEMORY_LIMIT=-1 su-exec wodby composer create-project "drupal/recommended-project:${DRUPAL_VER}" /usr/src/drupal --no-interaction; \ 20 | \ 21 | cd /usr/src/drupal; \ 22 | cp web/sites/default/default.settings.php web/sites/default/settings.php; \ 23 | mkdir -p web/sites/default/files; \ 24 | chmod 777 web/sites/default/files; \ 25 | chown wodby:wodby web/sites/default/settings.php web/sites/default/files; \ 26 | su-exec wodby composer require drush/drush; \ 27 | # @todo install console, currently in conflict https://github.com/hechoendrupal/drupal-console/issues/4220 28 | #su-exec wodby composer require --dev drupal/console:@stable; \ 29 | \ 30 | if [[ -z "${PHP_DEV}" ]]; then \ 31 | echo "$(cat /etc/sudoers.d/wodby), /usr/local/bin/init" > /etc/sudoers.d/wodby; \ 32 | fi; \ 33 | \ 34 | su-exec wodby composer clear-cache 35 | 36 | USER wodby 37 | 38 | COPY templates/settings.php.tmpl /etc/gotpl/ 39 | COPY init /docker-entrypoint-init.d/ 40 | COPY bin /usr/local/bin/ -------------------------------------------------------------------------------- /10/Makefile: -------------------------------------------------------------------------------- 1 | DRUPAL_VER ?= 10.6.1 2 | DRUPAL_VER_MAJOR ?= $(shell echo "${DRUPAL_VER}" | grep -oE '^[0-9]+') 3 | 4 | PHP_VER ?= 8.4 5 | BASE_IMAGE_TAG = $(PHP_VER) 6 | 7 | REPO = wodby/drupal 8 | NAME = drupal-$(DRUPAL_VER_MAJOR)-$(PHP_VER) 9 | 10 | TAG ?= $(DRUPAL_VER_MAJOR)-$(PHP_VER) 11 | 12 | PLATFORM ?= linux/arm64 13 | 14 | ifneq ($(BASE_IMAGE_STABILITY_TAG),) 15 | BASE_IMAGE_TAG := $(BASE_IMAGE_TAG)-$(BASE_IMAGE_STABILITY_TAG) 16 | endif 17 | 18 | IMAGETOOLS_TAG ?= $(TAG) 19 | 20 | ifneq ($(ARCH),) 21 | override TAG := $(TAG)-$(ARCH) 22 | endif 23 | 24 | .PHONY: build buildx-build buildx-push push shell run start stop logs clean release 25 | 26 | default: build 27 | 28 | build: 29 | docker build -t $(REPO):$(TAG) \ 30 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 31 | --build-arg DRUPAL_VER=$(DRUPAL_VER) \ 32 | ./ 33 | 34 | buildx-build: 35 | docker buildx build --platform $(PLATFORM) -t $(REPO):$(TAG) \ 36 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 37 | --build-arg DRUPAL_VER=$(DRUPAL_VER) \ 38 | ./ 39 | 40 | buildx-push: 41 | docker buildx build --platform $(PLATFORM) --push -t $(REPO):$(TAG) \ 42 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 43 | --build-arg DRUPAL_VER=$(DRUPAL_VER) \ 44 | ./ 45 | 46 | buildx-imagetools-create: 47 | docker buildx imagetools create -t $(REPO):$(IMAGETOOLS_TAG) \ 48 | $(REPO):$(TAG)-amd64 \ 49 | $(REPO):$(TAG)-arm64 50 | .PHONY: buildx-imagetools-create 51 | 52 | test: 53 | cd ./tests && IMAGE=$(REPO):$(TAG) ./run.sh 54 | 55 | push: 56 | docker push $(REPO):$(TAG) 57 | 58 | shell: 59 | docker run --rm --name $(NAME) -i -t $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) /bin/bash 60 | 61 | run: 62 | docker run --rm --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) $(CMD) 63 | 64 | start: 65 | docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) 66 | 67 | stop: 68 | docker stop $(NAME) 69 | 70 | logs: 71 | docker logs $(NAME) 72 | 73 | clean: 74 | -docker rm -f $(NAME) 75 | 76 | release: build push 77 | -------------------------------------------------------------------------------- /11/Makefile: -------------------------------------------------------------------------------- 1 | DRUPAL_VER ?= 11.3.1 2 | DRUPAL_VER_MAJOR ?= $(shell echo "${DRUPAL_VER}" | grep -oE '^[0-9]+') 3 | 4 | PHP_VER ?= 8.5 5 | BASE_IMAGE_TAG = $(PHP_VER) 6 | 7 | REPO = wodby/drupal 8 | NAME = drupal-$(DRUPAL_VER_MAJOR)-$(PHP_VER) 9 | 10 | TAG ?= $(DRUPAL_VER_MAJOR)-$(PHP_VER) 11 | 12 | PLATFORM ?= linux/arm64 13 | 14 | ifneq ($(BASE_IMAGE_STABILITY_TAG),) 15 | BASE_IMAGE_TAG := $(BASE_IMAGE_TAG)-$(BASE_IMAGE_STABILITY_TAG) 16 | endif 17 | 18 | IMAGETOOLS_TAG ?= $(TAG) 19 | 20 | ifneq ($(ARCH),) 21 | override TAG := $(TAG)-$(ARCH) 22 | endif 23 | 24 | .PHONY: build buildx-build buildx-push push shell run start stop logs clean release 25 | 26 | default: build 27 | 28 | build: 29 | docker build -t $(REPO):$(TAG) \ 30 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 31 | --build-arg DRUPAL_VER=$(DRUPAL_VER) \ 32 | ./ 33 | 34 | buildx-build: 35 | docker buildx build --platform $(PLATFORM) -t $(REPO):$(TAG) \ 36 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 37 | --build-arg DRUPAL_VER=$(DRUPAL_VER) \ 38 | ./ 39 | 40 | buildx-push: 41 | docker buildx build --platform $(PLATFORM) --push -t $(REPO):$(TAG) \ 42 | --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \ 43 | --build-arg DRUPAL_VER=$(DRUPAL_VER) \ 44 | ./ 45 | 46 | buildx-imagetools-create: 47 | docker buildx imagetools create -t $(REPO):$(IMAGETOOLS_TAG) \ 48 | $(REPO):$(TAG)-amd64 \ 49 | $(REPO):$(TAG)-arm64 50 | .PHONY: buildx-imagetools-create 51 | 52 | test: 53 | cd ./tests && IMAGE=$(REPO):$(TAG) ./run.sh 54 | 55 | push: 56 | docker push $(REPO):$(TAG) 57 | 58 | shell: 59 | docker run --rm --name $(NAME) -i -t $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) /bin/bash 60 | 61 | run: 62 | docker run --rm --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) $(CMD) 63 | 64 | start: 65 | docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) 66 | 67 | stop: 68 | docker stop $(NAME) 69 | 70 | logs: 71 | docker logs $(NAME) 72 | 73 | clean: 74 | -docker rm -f $(NAME) 75 | 76 | release: build push 77 | -------------------------------------------------------------------------------- /.github/actions/release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | if [[ "${GITHUB_REF}" == refs/heads/master || "${GITHUB_REF}" == refs/tags/* ]]; then 10 | minor_ver="${DRUPAL_VER%.*}" 11 | minor_tag="${minor_ver}" 12 | major_tag="${minor_ver%.*}" 13 | 14 | # e.g. drupal version 11.2.8 and php 8.4 15 | # 11.2-8.4 16 | tags=("${minor_tag}-${PHP_VER}") 17 | 18 | # 11.2 19 | if [[ -n "${LATEST_PHP}" ]]; then 20 | tags+=("${minor_tag}") 21 | fi 22 | 23 | if [[ -n "${LATEST_MAJOR}" ]]; then 24 | # 11-8.4 25 | tags+=("${major_tag}-${PHP_VER}") 26 | if [[ -n "${LATEST_PHP}" ]]; then 27 | # 11 28 | tags+=("${major_tag}") 29 | fi 30 | fi 31 | 32 | if [[ -n "${LATEST_MAJOR_PHP}" ]]; then 33 | # 11.2-8 34 | tags+=("${minor_tag}-${PHP_VER%.*}") 35 | if [[ -n "${LATEST_MAJOR}" ]]; then 36 | # 11-8 37 | tags+=("${major_tag}-${PHP_VER%.*}") 38 | fi 39 | fi 40 | 41 | if [[ "${GITHUB_REF}" == refs/tags/* ]]; then 42 | # e.g. tag 1.2.3 43 | stability_tag="${GITHUB_REF##*/}" 44 | # 11.2-8.4-1.2.3 45 | tags=("${minor_tag}-${PHP_VER}-${stability_tag}") 46 | if [[ -n "${LATEST_MAJOR}" ]]; then 47 | # 11-8.4-1.2.3 48 | tags+=("${major_tag}-${PHP_VER}-${stability_tag}") 49 | fi 50 | if [[ -n "${LATEST_MAJOR_PHP}" ]]; then 51 | # 11.2-8-1.2.3 52 | tags+=("${minor_tag}-${PHP_VER%.*}-${stability_tag}") 53 | if [[ -n "${LATEST_MAJOR}" ]]; then 54 | # 11-8-1.2.3 55 | tags+=("${major_tag}-${PHP_VER%.*}-${stability_tag}") 56 | fi 57 | fi 58 | if [[ -n "${LATEST_PHP}" ]]; then 59 | # 11.2-1.2.3 60 | tags+=("${minor_tag}-${stability_tag}") 61 | if [[ -n "${LATEST_MAJOR}" ]]; then 62 | # 11-1.2.3 63 | tags+=("${major_tag}-${stability_tag}") 64 | fi 65 | fi 66 | else 67 | if [[ -n "${LATEST}" ]]; then 68 | tags+=("latest") 69 | fi 70 | fi 71 | 72 | for tag in "${tags[@]}"; do 73 | make buildx-imagetools-create IMAGETOOLS_TAG=${tag} 74 | done 75 | fi -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vanilla Drupal Docker Container Image 2 | 3 | [![Build Status](https://github.com/wodby/drupal/workflows/Build%20docker%20image/badge.svg)](https://github.com/wodby/drupal/actions) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/wodby/drupal.svg)](https://hub.docker.com/r/wodby/drupal) 5 | [![Docker Stars](https://img.shields.io/docker/stars/wodby/drupal.svg)](https://hub.docker.com/r/wodby/drupal) 6 | 7 | ## Docker Images 8 | 9 | ❗For better reliability we release images with stability tags (`wodby/drupal:11-X.X.X`) which correspond 10 | to [git tags](https://github.com/wodby/drupal/releases). We strongly recommend using images only with stability tags. 11 | 12 | Overview: 13 | 14 | - All images are based on Alpine Linux 15 | - Base image: [wodby/drupal-php](https://github.com/wodby/drupal-php) 16 | - [GitHub actions builds](https://github.com/wodby/drupal/actions) 17 | - [Docker Hub](https://hub.docker.com/r/wodby/drupal) 18 | 19 | | Supported tags and respective `Dockerfile` links | Drupal | PHP | 20 | |--------------------------------------------------------------------------------------------------------------|--------|-----| 21 | | `11-8.5`, `11-8`, `11`, `latest` [_(Dockerfile)_](https://github.com/wodby/drupal/tree/master/11/Dockerfile) | 11 | 8.5 | 22 | | `11-8.4` [_(Dockerfile)_](https://github.com/wodby/drupal/tree/master/11/Dockerfile) | 11 | 8.4 | 23 | | `11-8.3` [_(Dockerfile)_](https://github.com/wodby/drupal/tree/master/11/Dockerfile) | 11 | 8.3 | 24 | | `10-8.4`, `10-8`, `10` [_(Dockerfile)_](https://github.com/wodby/drupal/tree/master/10/Dockerfile) | 10 | 8.4 | 25 | | `10-8.3` [_(Dockerfile)_](https://github.com/wodby/drupal/tree/master/10/Dockerfile) | 10 | 8.3 | 26 | | `10-8.2` [_(Dockerfile)_](https://github.com/wodby/drupal/tree/master/10/Dockerfile) | 10 | 8.2 | 27 | | `10-8.1` [_(Dockerfile)_](https://github.com/wodby/drupal/tree/master/10/Dockerfile) | 10 | 8.1 | 28 | 29 | All images built for `linux/amd64` and `linux/arm64` 30 | 31 | ## Environment Variables 32 | 33 | ##### settings.php variables 34 | 35 | | Variable | Default Value | 36 | |--------------------------------|-------------------------------------------| 37 | | `DB_HOST` | `mariadb` | 38 | | `DB_NAME` | `drupal` | 39 | | `DB_USER` | `drupal` | 40 | | `DB_PASSWORD` | `drupal` | 41 | | `DB_DRIVER` | `mysql` | 42 | | `DB_PREFIX` | | 43 | | `DRUPAL_TRUSTED_HOST_PATTERNS` | `'\\.localhost$', '\\.local$', '\\.loc$'` | 44 | 45 | See [wodby/drupal-php](https://github.com/wodby/drupal-php) for all variables. 46 | 47 | ## Orchestration Actions 48 | 49 | See [wodby/drupal-php](https://github.com/wodby/drupal-php) for all actions. 50 | 51 | ## Complete Drupal Stack 52 | 53 | See [wodby/docker4drupal](https://github.com/wodby/docker4drupal) 54 | -------------------------------------------------------------------------------- /.github/workflows/workflow.yml: -------------------------------------------------------------------------------- 1 | name: Build docker image 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - 4.x 8 | 9 | tags: 10 | - '*' 11 | 12 | pull_request: 13 | 14 | env: 15 | DRUPAL11: '11.3.1' 16 | DRUPAL10: '10.6.1' 17 | 18 | jobs: 19 | build-drupal11: 20 | strategy: 21 | matrix: 22 | php: [ '8.5', '8.4', '8.3' ] 23 | arch: 24 | - amd64 25 | - arm64 26 | include: 27 | - arch: amd64 28 | runner: ubuntu-24.04 29 | - arch: arm64 30 | runner: ubuntu-24.04-arm 31 | runs-on: ${{ matrix.runner }} 32 | steps: 33 | - uses: actions/checkout@v6 34 | - uses: docker/login-action@v3 35 | with: 36 | username: ${{ secrets.DOCKER_USERNAME }} 37 | password: ${{ secrets.DOCKER_PASSWORD }} 38 | - name: build and push 39 | env: 40 | DRUPAL_VER: ${{ env.DRUPAL11 }} 41 | PHP_VER: ${{ matrix.php }} 42 | ARCH: ${{ matrix.arch }} 43 | working-directory: '11' 44 | run: | 45 | make 46 | make test 47 | make push 48 | 49 | build-drupal10: 50 | strategy: 51 | matrix: 52 | php: [ '8.4', '8.3', '8.2', '8.1' ] 53 | arch: 54 | - amd64 55 | - arm64 56 | include: 57 | - arch: amd64 58 | runner: ubuntu-24.04 59 | - arch: arm64 60 | runner: ubuntu-24.04-arm 61 | runs-on: ${{ matrix.runner }} 62 | steps: 63 | - uses: actions/checkout@v6 64 | - uses: docker/login-action@v3 65 | with: 66 | username: ${{ secrets.DOCKER_USERNAME }} 67 | password: ${{ secrets.DOCKER_PASSWORD }} 68 | - name: build and push 69 | env: 70 | DRUPAL_VER: ${{ env.DRUPAL10 }} 71 | PHP_VER: ${{ matrix.php }} 72 | ARCH: ${{ matrix.arch }} 73 | working-directory: '10' 74 | run: | 75 | make 76 | make test 77 | make push 78 | 79 | push-drupal11: 80 | runs-on: ubuntu-latest 81 | needs: 82 | - build-drupal11 83 | strategy: 84 | matrix: 85 | php: [ '8.5', '8.4', '8.3' ] 86 | include: 87 | - php: '8.5' 88 | latest_major_php: '1' 89 | latest_php: '1' 90 | steps: 91 | - uses: actions/checkout@v6 92 | - uses: docker/login-action@v3 93 | with: 94 | username: ${{ secrets.DOCKER_USERNAME }} 95 | password: ${{ secrets.DOCKER_PASSWORD }} 96 | - uses: ./.github/actions 97 | with: 98 | version: ${{ env.DRUPAL11 }} 99 | php: ${{ matrix.php }} 100 | latest: 1 101 | # we only have one version of major drupal. 102 | latest_major: 1 103 | latest_php: ${{ matrix.latest_php }} 104 | latest_major_php: ${{ matrix.latest_major_php }} 105 | workdir: 11 106 | 107 | push-drupal10: 108 | runs-on: ubuntu-latest 109 | needs: 110 | - build-drupal10 111 | strategy: 112 | matrix: 113 | php: [ '8.4', '8.3', '8.2', '8.1' ] 114 | include: 115 | - php: '8.4' 116 | latest_major_php: '1' 117 | latest_php: '1' 118 | steps: 119 | - uses: actions/checkout@v6 120 | - uses: docker/login-action@v3 121 | with: 122 | username: ${{ secrets.DOCKER_USERNAME }} 123 | password: ${{ secrets.DOCKER_PASSWORD }} 124 | - uses: ./.github/actions 125 | with: 126 | version: ${{ env.DRUPAL10 }} 127 | php: ${{ matrix.php }} 128 | # we only have one version of major drupal. 129 | latest_major: 1 130 | latest_php: ${{ matrix.latest_php }} 131 | latest_major_php: ${{ matrix.latest_major_php }} 132 | workdir: 10 133 | --------------------------------------------------------------------------------