Skip to content

Commit

Permalink
Add additional packages and dependencies for PHP Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tfirdaus committed Dec 29, 2023
1 parent 47b8750 commit 1866b0f
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 73 deletions.
27 changes: 18 additions & 9 deletions php/7.4/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM axllent/mailpit as mailpit
FROM serversideup/php:7.4-cli

# Xdebug compatibility: https://xdebug.org/docs/compat
# Use Xdebug for debugging and generating code coverage reports.
ENV PHP_XDEBUG_VERSION 3.1.6

# Install the PHP extensions.
RUN pecl install "xdebug-${PHP_XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug; \
php -m;
# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
php7.4-xdebug \
# Require to be able to interact with Git, such as clone, pull, and push to the remote repositories
# e.g. when developing within the container with devcontainer
git \
ssh \
# Required for Composer to unpack ZIP archives that otherwise throws the following warning:
# As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
# This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
# Installing 'unzip' or '7z' (21.01+) may remediate them.
unzip \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
php -m;

# VSCode configs
RUN mkdir -p /var/www/.vscode-server; \
Expand Down
27 changes: 18 additions & 9 deletions php/7.4/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM axllent/mailpit as mailpit
FROM serversideup/php:7.4-fpm

# Xdebug compatibility: https://xdebug.org/docs/compat
# Use Xdebug for debugging and generating code coverage reports.
ENV PHP_XDEBUG_VERSION 3.1.6

# Install the PHP extensions.
RUN pecl install "xdebug-${PHP_XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug; \
php -m;
# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
php7.4-xdebug \
# Require to be able to interact with Git, such as clone, pull, and push to the remote repositories
# e.g. when developing within the container with devcontainer
git \
ssh \
# Required for Composer to unpack ZIP archives that otherwise throws the following warning:
# As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
# This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
# Installing 'unzip' or '7z' (21.01+) may remediate them.
unzip \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
php -m;

# VSCode configs
RUN mkdir -p /var/www/.vscode-server; \
Expand Down
27 changes: 18 additions & 9 deletions php/8.0/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM axllent/mailpit as mailpit
FROM serversideup/php:8.0-cli

# Xdebug compatibility: https://xdebug.org/docs/compat
# Use Xdebug for debugging and generating code coverage reports.
ENV PHP_XDEBUG_VERSION 3.3.0

# Install the PHP extensions.
RUN pecl install "xdebug-${PHP_XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug; \
php -m;
# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
php8.0-xdebug \
# Require to be able to interact with Git, such as clone, pull, and push to the remote repositories
# e.g. when developing within the container with devcontainer
git \
ssh \
# Required for Composer to unpack ZIP archives that otherwise throws the following warning:
# As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
# This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
# Installing 'unzip' or '7z' (21.01+) may remediate them.
unzip \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
php -m;

# VSCode configs
RUN mkdir -p /var/www/.vscode-server; \
Expand Down
27 changes: 18 additions & 9 deletions php/8.0/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM axllent/mailpit as mailpit
FROM serversideup/php:8.0-fpm

# Xdebug compatibility: https://xdebug.org/docs/compat
# Use Xdebug for debugging and generating code coverage reports.
ENV PHP_XDEBUG_VERSION 3.3.0

# Install the PHP extensions.
RUN pecl install "xdebug-${PHP_XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug; \
php -m;
# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
php8.0-xdebug \
# Require to be able to interact with Git, such as clone, pull, and push to the remote repositories
# e.g. when developing within the container with devcontainer
git \
ssh \
# Required for Composer to unpack ZIP archives that otherwise throws the following warning:
# As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
# This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
# Installing 'unzip' or '7z' (21.01+) may remediate them.
unzip \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
php -m;

# VSCode configs
RUN mkdir -p /var/www/.vscode-server; \
Expand Down
29 changes: 19 additions & 10 deletions php/8.1/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM axllent/mailpit as mailpit
FROM serversideup/php:8.1-cli
FROM serversideup/php:8.1-fpm

# Xdebug compatibility: https://xdebug.org/docs/compat
# Use Xdebug for debugging and generating code coverage reports.
ENV PHP_XDEBUG_VERSION 3.3.0

# Install the PHP extensions.
RUN pecl install "xdebug-${PHP_XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug; \
php -m;
# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
php8.1-xdebug \
# Require to be able to interact with Git, such as clone, pull, and push to the remote repositories
# e.g. when developing within the container with devcontainer
git \
ssh \
# Required for Composer to unpack ZIP archives that otherwise throws the following warning:
# As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
# This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
# Installing 'unzip' or '7z' (21.01+) may remediate them.
unzip \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
php -m;

# VSCode configs
RUN mkdir -p /var/www/.vscode-server; \
Expand Down
27 changes: 18 additions & 9 deletions php/8.1/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM axllent/mailpit as mailpit
FROM serversideup/php:8.1-fpm

# Xdebug compatibility: https://xdebug.org/docs/compat
# Use Xdebug for debugging and generating code coverage reports.
ENV PHP_XDEBUG_VERSION 3.3.0

# Install the PHP extensions.
RUN pecl install "xdebug-${PHP_XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug; \
php -m;
# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
php8.1-xdebug \
# Require to be able to interact with Git, such as clone, pull, and push to the remote repositories
# e.g. when developing within the container with devcontainer
git \
ssh \
# Required for Composer to unpack ZIP archives that otherwise throws the following warning:
# As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
# This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
# Installing 'unzip' or '7z' (21.01+) may remediate them.
unzip \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
php -m;

# VSCode configs
RUN mkdir -p /var/www/.vscode-server; \
Expand Down
27 changes: 18 additions & 9 deletions php/8.2/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM axllent/mailpit as mailpit
FROM serversideup/php:8.2-cli

# Xdebug compatibility: https://xdebug.org/docs/compat
# Use Xdebug for debugging and generating code coverage reports.
ENV PHP_XDEBUG_VERSION 3.3.0

# Install the PHP extensions.
RUN pecl install "xdebug-${PHP_XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug; \
php -m;
# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
php8.2-xdebug \
# Require to be able to interact with Git, such as clone, pull, and push to the remote repositories
# e.g. when developing within the container with devcontainer
git \
ssh \
# Required for Composer to unpack ZIP archives that otherwise throws the following warning:
# As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
# This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
# Installing 'unzip' or '7z' (21.01+) may remediate them.
unzip \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
php -m;

# VSCode configs
RUN mkdir -p /var/www/.vscode-server; \
Expand Down
27 changes: 18 additions & 9 deletions php/8.2/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM axllent/mailpit as mailpit
FROM serversideup/php:8.2-fpm

# Xdebug compatibility: https://xdebug.org/docs/compat
# Use Xdebug for debugging and generating code coverage reports.
ENV PHP_XDEBUG_VERSION 3.3.0

# Install the PHP extensions.
RUN pecl install "xdebug-${PHP_XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug; \
php -m;
# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
php8.2-xdebug \
# Require to be able to interact with Git, such as clone, pull, and push to the remote repositories
# e.g. when developing within the container with devcontainer
git \
ssh \
# Required for Composer to unpack ZIP archives that otherwise throws the following warning:
# As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
# This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
# Installing 'unzip' or '7z' (21.01+) may remediate them.
unzip \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
php -m;

# VSCode configs
RUN mkdir -p /var/www/.vscode-server; \
Expand Down
11 changes: 11 additions & 0 deletions wp/php7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ LABEL org.opencontainers.image.description "Image to run WordPress with PHP 7.4.
ENV NODE_VERSION 20
ENV WP_VERSION 6.4

# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# Ghostscript is required for rendering PDF previews
ghostscript \
# Required for WP-CLI "wp db" command to run properly that otherwise throws "'mysqlcheck': No such file or directory."
default-mysql-client \
; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;

COPY --from=wp-cli /usr/local/bin/wp /usr/local/bin/

RUN set -eux; \
Expand Down
11 changes: 11 additions & 0 deletions wp/php8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ LABEL org.opencontainers.image.description "Image to run WordPress with PHP 8.0.
ENV NODE_VERSION 20
ENV WP_VERSION 6.4

# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# Ghostscript is required for rendering PDF previews
ghostscript \
# Required for WP-CLI "wp db" command to run properly that otherwise throws "'mysqlcheck': No such file or directory."
default-mysql-client \
; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;

COPY --from=wp-cli /usr/local/bin/wp /usr/local/bin/

RUN set -eux; \
Expand Down
11 changes: 11 additions & 0 deletions wp/php8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ LABEL org.opencontainers.image.description "Image to run WordPress with PHP 8.1.
ENV NODE_VERSION 20
ENV WP_VERSION 6.4

# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# Ghostscript is required for rendering PDF previews
ghostscript \
# Required for WP-CLI "wp db" command to run properly that otherwise throws "'mysqlcheck': No such file or directory."
default-mysql-client \
; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;

COPY --from=wp-cli /usr/local/bin/wp /usr/local/bin/

RUN set -eux; \
Expand Down
11 changes: 11 additions & 0 deletions wp/php8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ LABEL org.opencontainers.image.description "Image to run WordPress with PHP 8.2.
ENV NODE_VERSION 20
ENV WP_VERSION 6.4

# Install additional packages.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# Ghostscript is required for rendering PDF previews
ghostscript \
# Required for WP-CLI "wp db" command to run properly that otherwise throws "'mysqlcheck': No such file or directory."
default-mysql-client \
; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;

COPY --from=wp-cli /usr/local/bin/wp /usr/local/bin/

RUN set -eux; \
Expand Down

0 comments on commit 1866b0f

Please sign in to comment.