|
2 | 2 | # VERSION: release |
3 | 3 |
|
4 | 4 | ARG DEBIAN_RELEASE=bookworm |
| 5 | +FROM discourse/ruby:3.3.6-${DEBIAN_RELEASE}-slim AS builder |
| 6 | +RUN apt update && \ |
| 7 | +DEBIAN_FRONTEND=noninteractive apt-get -y install wget \ |
| 8 | + autoconf build-essential \ |
| 9 | + git \ |
| 10 | + cmake \ |
| 11 | + gnupg \ |
| 12 | + libpcre3-dev \ |
| 13 | + libfreetype6-dev \ |
| 14 | + libbrotli-dev |
| 15 | + |
| 16 | +FROM builder AS imagemagick_builder |
| 17 | +ADD install-imagemagick /tmp/install-imagemagick |
| 18 | +RUN /tmp/install-imagemagick |
| 19 | + |
5 | 20 | FROM discourse/ruby:3.3.6-${DEBIAN_RELEASE}-slim AS discourse_dependencies |
6 | 21 |
|
7 | 22 | ARG DEBIAN_RELEASE |
@@ -36,7 +51,13 @@ RUN --mount=type=tmpfs,target=/var/log \ |
36 | 51 | libreadline-dev anacron wget \ |
37 | 52 | psmisc whois brotli libunwind-dev \ |
38 | 53 | libtcmalloc-minimal4 cmake \ |
39 | | - pngcrush pngquant ripgrep poppler-utils; \ |
| 54 | + pngcrush pngquant ripgrep poppler-utils \ |
| 55 | +# imagemagick runtime dependencies |
| 56 | + libheif1 libjbig0 libtiff6 libpng16-16 libfontconfig1 \ |
| 57 | + libwebpdemux2 libwebpmux3 libxext6 librsvg2-2 libgomp1 \ |
| 58 | + fonts-urw-base35 \ |
| 59 | +# nginx compile dependencies \ |
| 60 | + libfreetype6-dev && \ |
40 | 61 | # install these without recommends to avoid pulling in e.g. |
41 | 62 | # X11 libraries, mailutils |
42 | 63 | DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends git rsyslog logrotate cron ssh-client less; \ |
@@ -70,8 +91,24 @@ RUN sed -i "s/^# $LANG/$LANG/" /etc/locale.gen; \ |
70 | 91 | RUN --mount=type=tmpfs,target=/root/.npm \ |
71 | 92 | npm install -g terser uglify-js pnpm |
72 | 93 |
|
73 | | -ADD install-imagemagick /tmp/install-imagemagick |
74 | | -RUN /tmp/install-imagemagick |
| 94 | +# Copy binary and configuration files for magick |
| 95 | +COPY --from=imagemagick_builder /usr/local/bin/magick /usr/local/bin/magick |
| 96 | +COPY --from=imagemagick_builder /usr/local/etc/ImageMagick-7 /usr/local/etc/ImageMagick-7 |
| 97 | +COPY --from=imagemagick_builder /usr/local/share/ImageMagick-7 /usr/local/share/ImageMagick-7 |
| 98 | +# Create symlinks to imagemagick tools |
| 99 | +RUN ln -s /usr/local/bin/magick /usr/local/bin/animate &&\ |
| 100 | + ln -s /usr/local/bin/magick /usr/local/bin/compare &&\ |
| 101 | + ln -s /usr/local/bin/magick /usr/local/bin/composite &&\ |
| 102 | + ln -s /usr/local/bin/magick /usr/local/bin/conjure &&\ |
| 103 | + ln -s /usr/local/bin/magick /usr/local/bin/convert &&\ |
| 104 | + ln -s /usr/local/bin/magick /usr/local/bin/display &&\ |
| 105 | + ln -s /usr/local/bin/magick /usr/local/bin/identify &&\ |
| 106 | + ln -s /usr/local/bin/magick /usr/local/bin/import &&\ |
| 107 | + ln -s /usr/local/bin/magick /usr/local/bin/magick-script &&\ |
| 108 | + ln -s /usr/local/bin/magick /usr/local/bin/mogrify &&\ |
| 109 | + ln -s /usr/local/bin/magick /usr/local/bin/montage &&\ |
| 110 | + ln -s /usr/local/bin/magick /usr/local/bin/stream &&\ |
| 111 | + test $(magick -version | grep -o -e png -e tiff -e jpeg -e freetype -e heic -e webp | wc -l) -eq 6 |
75 | 112 |
|
76 | 113 | ADD install-jemalloc /tmp/install-jemalloc |
77 | 114 | RUN /tmp/install-jemalloc |
|
0 commit comments