nextcloud: Allow to disable imagick without having to enable it each time

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2025-12-17 15:24:28 +01:00
parent adedd78c34
commit 7b91fcbbd3
2 changed files with 6 additions and 7 deletions

View file

@ -93,6 +93,7 @@ RUN set -ex; \
apcu \ apcu \
memcached \ memcached \
redis \ redis \
imagick \
; \ ; \
rm -r /tmp/pear; \ rm -r /tmp/pear; \
\ \

View file

@ -86,15 +86,13 @@ fi
# Install additional php extensions # Install additional php extensions
if [ -n "$ADDITIONAL_PHP_EXTENSIONS" ]; then if [ -n "$ADDITIONAL_PHP_EXTENSIONS" ]; then
if ! [ -f "/additional-php-extensions-are-installed" ]; then if ! [ -f "/additional-php-extensions-are-installed" ]; then
# Allow to disable imagick without having to enable it each time
if ! echo "$ADDITIONAL_PHP_EXTENSIONS" | grep -q imagick; then
# Remove the ini file as there is no docker-php-ext-disable script available
rm /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini
fi
read -ra ADDITIONAL_PHP_EXTENSIONS_ARRAY <<< "$ADDITIONAL_PHP_EXTENSIONS" read -ra ADDITIONAL_PHP_EXTENSIONS_ARRAY <<< "$ADDITIONAL_PHP_EXTENSIONS"
for app in "${ADDITIONAL_PHP_EXTENSIONS_ARRAY[@]}"; do for app in "${ADDITIONAL_PHP_EXTENSIONS_ARRAY[@]}"; do
if [ "$app" = imagick ]; then
echo "Enabling Imagick..."
if ! docker-php-ext-enable imagick >/dev/null; then
echo "Could not install PHP extension imagick!"
fi
continue
fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
if [ "$PHP_DEPS_ARE_INSTALLED" != 1 ]; then if [ "$PHP_DEPS_ARE_INSTALLED" != 1 ]; then
echo "Installing PHP build dependencies..." echo "Installing PHP build dependencies..."