Skip to content

Instantly share code, notes, and snippets.

@bfcoder
Created March 3, 2023 18:13
Show Gist options
  • Save bfcoder/6638fbe2a67b449426de830e951acb59 to your computer and use it in GitHub Desktop.
Save bfcoder/6638fbe2a67b449426de830e951acb59 to your computer and use it in GitHub Desktop.
Docker build imagemagick in alpine linux with heic support
FROM alpine
ARG IMAGICK_VERSION="7.1.0-62"
# Add build tooling and dependencies
RUN apk add --no-cache --virtual .build-deps \
build-base \
libde265-dev \
libheif-dev
# Build and install ImageMagick
RUN mkdir /usr/src \
&& cd /usr/src \
&& wget -c https://download.imagemagick.org/archive/releases/ImageMagick-${IMAGICK_VERSION}.tar.gz -O - | tar -xz \
&& cd ImageMagick-* \
&& ./configure --with-heic=yes \
&& make \
&& make install \
&& ldconfig /usr/local/lib \
&& cd / \
&& rm -rf /usr/src
# Clean up build deps and add the non-dev linked libs
RUN apk del --no-cache .build-deps
RUN apk add --no-cache \
libde265 \
libheif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment