How can i add imagick to frankenphp #2046
Replies: 2 comments 4 replies
-
|
It would be helpful to include the error or issue you're running into. |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
After thourough research, i found out i need to install imagemagick in the system for the php imagick extension to work. So i updated the Dockerfile to install FROM dunglas/frankenphp:builder AS builder
# Copy xcaddy in the builder image
COPY --from=caddy:builder /usr/bin/xcaddy /usr/bin/xcaddy
# CGO must be enabled to build FrankenPHP
RUN CGO_ENABLED=1 \
XCADDY_SETCAP=1 \
XCADDY_GO_BUILD_FLAGS="-ldflags='-w -s' -tags=nobadger,nomysql,nopgx" \
CGO_CFLAGS=$(php-config --includes) \
CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \
xcaddy build \
--output /usr/local/bin/frankenphp \
--with github.com/dunglas/frankenphp=./ \
--with github.com/dunglas/frankenphp/caddy=./caddy/ \
--with github.com/dunglas/caddy-cbrotli \
# Mercure and Vulcain are included in the official build, but feel free to remove them
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
# Add extra Caddy modules here
FROM dunglas/frankenphp:latest AS runner
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libmagickwand-dev \
imagemagick \
&& rm -rf /var/lib/apt/lists/*
# add additional extensions here:
RUN install-php-extensions \
pdo_mysql \
gd \
intl \
imagick \
zip \
opcache
# Replace the official binary by the one contained your custom modules
COPY --from=builder /usr/local/bin/frankenphp /usr/local/bin/frankenphp |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings...
Please i've tried various possible means to build frankenphp with imagick extension included in the build to no avail.
Here is my docker file
Beta Was this translation helpful? Give feedback.
All reactions