Skip to content

Commit b2993c5

Browse files
authored
Merge pull request #127 from NethServer/frederico
Add Imagick support and ensure ca-certificates installation in Containerfile
2 parents e326a82 + a7f49dd commit b2993c5

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

container/Containerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ ARG PHP_BUILD_DEPS="\
3636
pkg-config \
3737
libc-client-dev \
3838
libkrb5-dev \
39+
libmagickwand-dev \
40+
libmagick++-dev \
3941
"
4042

4143
ARG PHP_EXTENSIONS="\
@@ -66,6 +68,7 @@ RUN set -eux \
6668
# --- Install runtime libraries depending on Debian codename ---
6769
&& apt update \
6870
&& apt upgrade -y \
71+
&& apt install -y ca-certificates \
6972
&& if echo "$PHP_VERSION_IMAGE" | grep -q "bullseye$"; then \
7073
apt install -y --no-install-recommends \
7174
libc-client2007e \
@@ -78,7 +81,8 @@ RUN set -eux \
7881
libpq5 \
7982
libtidy5deb1 \
8083
libxslt1.1 \
81-
libzip4; \
84+
libzip4 \
85+
libmagickwand-6.q16-6; \
8286
elif echo "$PHP_VERSION_IMAGE" | grep -q "bookworm$"; then \
8387
apt install -y --no-install-recommends \
8488
libc-client2007e \
@@ -91,7 +95,8 @@ RUN set -eux \
9195
libpq5 \
9296
libtidy5deb1 \
9397
libxslt1.1 \
94-
libzip4; \
98+
libzip4 \
99+
libmagickwand-6.q16-6; \
95100
else \
96101
echo "Unsupported Debian version: $CODENAME" && exit 1; \
97102
fi \
@@ -124,19 +129,27 @@ RUN set -eux \
124129
docker-php-ext-enable imap; \
125130
fi \
126131
\
132+
# --- Install imagick via PECL ---
133+
&& pecl install imagick \
134+
|| { \
135+
echo 'PECL imagick install failed'; \
136+
exit 11; \
137+
} \
138+
&& docker-php-ext-enable imagick \
139+
\
127140
# --- Cleanup build deps ---
128141
&& apt purge -y $PHP_BUILD_DEPS \
129142
&& apt autoremove -y \
130143
&& apt clean \
131144
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
132145
&& ldconfig \
133-
146+
\
134147
# --- Verify all extensions loaded and their runtime dependencies ---
135148
# Exit codes:
136149
# 20 - Missing PHP extension
137150
# 30 - Missing .so file for extension
138151
# 40 - Missing runtime dependency for extension
139-
&& for ext in $PHP_EXTENSIONS imap; do \
152+
&& for ext in $PHP_EXTENSIONS imap imagick; do \
140153
php -m \
141154
| grep -qi "$ext" \
142155
> /dev/null 2>&1 \

0 commit comments

Comments
 (0)