Skip to content

Commit

Permalink
Get rid of PHP_PACKAGES arg to allow dynamic changing the list in the…
Browse files Browse the repository at this point in the history
… Dockerfile
  • Loading branch information
baschny committed Apr 15, 2024
1 parent 15585de commit 192d55f
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,12 @@

ARG PHP_MINOR_VERSION=8.2
ARG NODE_VERSION=18
ARG PHP_PACKAGES=" \
apcu \
bcmath \
bz2 \
calendar \
exif \
gd \
gettext \
igbinary \
imagick \
intl \
mcrypt \
mysqli \
opcache \
pcntl \
pdo_mysql \
redis \
shmop \
soap \
sockets \
sysvmsg \
sysvsem \
sysvshm \
uuid \
xdebug \
yaml \
zip \
"

# -------------------------------------------------------------------------

FROM php:${PHP_MINOR_VERSION}-fpm as php-fpm

ARG PHP_MINOR_VERSION
ARG PHP_PACKAGES

RUN echo 'APT::Install-Recommends "0";' >> /etc/apt/apt.conf.d/phpapp-norecommends && \
echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/phpapp-suggests
Expand All @@ -59,7 +30,36 @@ RUN <<EOF
EOF

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/
RUN install-php-extensions $PHP_PACKAGES
RUN <<EOT bash
set -ex
PHP_EXTENSIONS=(
"bz2"
"calendar"
"exif"
"gd"
"gettext"
"igbinary"
"imagick"
"intl"
"mcrypt"
"mysqli"
"opcache"
"pcntl"
"pdo_mysql"
"redis"
"shmop"
"soap"
"sockets"
"sysvmsg"
"sysvsem"
"sysvshm"
"uuid"
"xdebug"
"yaml"
"zip"
)
install-php-extensions \${PHP_EXTENSIONS[@]}
EOT

# Other tools
RUN apt-get -qq update && apt-get -q install -y \
Expand Down

0 comments on commit 192d55f

Please sign in to comment.