Skip to content

Commit b76ac4d

Browse files
committed
Add PHP 8.4
1 parent a128bf8 commit b76ac4d

File tree

9 files changed

+4062
-2
lines changed

9 files changed

+4062
-2
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build php-84 docker images multi-arch
2+
3+
on:
4+
push:
5+
branches:
6+
- multi-arch
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Get branch names
14+
id: branch-name
15+
uses: tj-actions/branch-names@v5
16+
- name: checkout code
17+
uses: actions/checkout@v2
18+
- name: login to docker hub
19+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
20+
- name: create --use
21+
run: docker buildx create --use
22+
- name: Set up QEMU
23+
id: qemu
24+
uses: docker/setup-qemu-action@v1
25+
with:
26+
image: tonistiigi/binfmt:latest
27+
platforms: all
28+
- name: buildx ls
29+
run: docker buildx ls
30+
- name: build the branch-specific images for amd64/arm64
31+
if: steps.branch-name.outputs.current_branch != 'master'
32+
run: ./build.sh both 83 ${{ steps.branch-name.outputs.current_branch }}
33+
- name: build the main images for amd64/arm64
34+
if: steps.branch-name.outputs.current_branch == 'master'
35+
run: ./build.sh both 84

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export WHAT=$1
1313

1414
if [ -z $2 ]
1515
then
16-
export VERSIONS_TO_BUILD="81 82 83"
16+
export VERSIONS_TO_BUILD="81 82 83 84"
1717
else
1818
export VERSIONS_TO_BUILD="$2"
1919
fi
@@ -77,7 +77,7 @@ function build_node_and_push_image() {
7777
local php_version=$1
7878
local base_image_tag=$2
7979
local suffix=$3
80-
local node_versions=("12" "14" "16")
80+
local node_versions=("12" "14" "16" "18" "20" "22")
8181
for node_version in "${node_versions[@]}"
8282
do
8383
local tag=php-$php_version-node-$node_version$suffix

php-node/Dockerfile.php-84

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ARG BASE_IMAGE_TAG
2+
3+
FROM factorial/drupal-docker:$BASE_IMAGE_TAG
4+
5+
LABEL org.opencontainers.image.authors="[email protected]"
6+
7+
ARG NODE_VERSION=14
8+
ENV NVM_DIR /usr/local/nvm
9+
RUN mkdir -p $NVM_DIR
10+
11+
RUN apt-get update \
12+
&& apt-get install -y --no-install-recommends curl gnupg ca-certificates \
13+
&& curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | bash \
14+
&& . /$NVM_DIR/nvm.sh \
15+
&& nvm install $NODE_VERSION \
16+
&& nvm alias default $NODE_VERSION \
17+
&& nvm use default \
18+
&& npm install -g yarn \
19+
&& npm config delete prefix
20+
21+
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
22+
ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH

php-wkhtmltopdf/Dockerfile.php-84

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ARG BASE_IMAGE_TAG
2+
3+
FROM factorial/drupal-docker:$BASE_IMAGE_TAG
4+
5+
LABEL org.opencontainers.image.authors="[email protected]"
6+
7+
RUN apt-get update && apt-get install -y wget xfonts-base xfonts-75dpi pdftk xz-utils
8+
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
9+
&& case "${dpkgArch##*-}" in \
10+
arm64) ARCH='arm64';; \
11+
*) ARCH='amd64' ;; \
12+
esac \
13+
&& wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_$ARCH.deb \
14+
&& dpkg -i wkhtmltox_0.12.6.1-3.bookworm_$ARCH.deb

php-xdebug/Dockerfile.php-84

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ARG BASE_IMAGE_TAG
2+
FROM factorial/drupal-docker:$BASE_IMAGE_TAG
3+
4+
LABEL org.opencontainers.image.authors="[email protected]"
5+
6+
RUN dpkg-divert --local --rename --add /sbin/initctl
7+
RUN ln -sf /bin/true /sbin/initctl
8+
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update --fix-missing && apt-get -y -q install php-xdebug

php/Dockerfile.php-84

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# dockerized drupal development box
2+
# includes apache, php, xhprof, imagemagick, sshd and drush
3+
# No mysql, use a dedicated mysql-docker-image and link the container.
4+
#
5+
# VERSION php-84
6+
# DOCKER-VERSION 2
7+
FROM debian:bookworm
8+
LABEL org.opencontainers.image.authors="[email protected]"
9+
10+
RUN dpkg-divert --local --rename --add /sbin/initctl
11+
RUN ln -sf /bin/true /sbin/initctl
12+
13+
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update --fix-missing && apt-get -y -q install git default-mysql-client wget optipng pngquant webp jpegoptim apt-transport-https lsb-release ca-certificates sqlite3
14+
15+
# Prepare php8.1
16+
RUN /usr/bin/wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
17+
RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
18+
19+
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update --fix-missing && apt-get -y -q install rsync unzip apache2 pwgen python3-pip vim-tiny openssh-server cron vim curl graphviz make imagemagick libapache2-mod-php8.4 php8.4-mysql php8.4-curl php8.4-memcache php8.4-redis php8.4-mbstring php8.4-zip php8.4-gd php8.4-dom php8.4-xml php8.4-bcmath php8.4-soap php8.4-sqlite3 php8.4-apcu php8.4-intl
20+
21+
# composer and drush
22+
RUN curl -ss https://getcomposer.org/installer | php
23+
RUN mv composer.phar /usr/local/bin/composer
24+
RUN mkdir -p /.cache && chmod -R 777 /.cache
25+
RUN /usr/local/bin/composer global require "drush/drush"
26+
RUN sed -i '1i export PATH="$HOME/.config/composer/vendor/bin:$PATH"' /root/.bashrc
27+
28+
29+
# sshd
30+
RUN DEBIAN_FRONTEND=noninteractive apt-get autoclean
31+
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
32+
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
33+
RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config
34+
RUN mkdir /var/run/sshd
35+
RUN echo 'root:root' |chpasswd
36+
37+
# configure apache
38+
RUN sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
39+
RUN a2enmod rewrite vhost_alias
40+
41+
RUN pip3 install supervisor --break-system-packages
42+
ADD ./common/start.sh /start.sh
43+
ADD ./common/foreground.sh /etc/apache2/foreground.sh
44+
ADD ./common/apache-vhost.conf /etc/apache2/sites-available/000-default.conf
45+
ADD ./common/supervisord.conf /etc/supervisord.conf
46+
ADD ./php-84/php.ini /etc/php/8.4/apache2/php.ini
47+
ADD ./php-84/php_cli.ini /etc/php/8.4/cli/php.ini
48+
ADD ./php-84/phpsendmail /usr/local/bin/phpsendmail
49+
RUN chmod +x /usr/local/bin/phpsendmail
50+
RUN touch /var/log/mail_php.log
51+
RUN chmod 777 /var/log/mail_php.log
52+
RUN touch /var/log/php_errors.log
53+
RUN chmod 777 /var/log/php_errors.log
54+
55+
RUN chmod 755 /start.sh /etc/apache2/foreground.sh
56+
EXPOSE 80
57+
CMD ["/bin/bash", "/start.sh"]

0 commit comments

Comments
 (0)