forked from skry-ab/heroku-buildpack-imagemagick-heif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
67 lines (54 loc) · 2.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM heroku/heroku:20-build
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
libheif-dev libjpeg-dev libpng-dev libtiff-dev libgif-dev libomp-dev
RUN curl -L https://github.com/strukturag/libde265/releases/download/v1.0.8/libde265-1.0.8.tar.gz | tar zx \
&& cd libde265-1.0.8 \
&& ./autogen.sh \
&& ./configure --prefix=/usr/src/imagemagick \
&& make \
&& make install
RUN curl -L https://github.com/strukturag/libheif/releases/download/v1.12.0/libheif-1.12.0.tar.gz | tar zx \
&& cd libheif-1.12.0 \
&& ./autogen.sh \
&& ./configure --prefix=/usr/src/imagemagick \
&& make \
&& make install
RUN cd /opt \
&& curl -L http://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2.tar.gz | tar zx \
&& cd libwebp-1.2.2 \
&& ./configure \
&& make \
&& make install
ENV PATH="/usr/src/imagemagick/bin:$PATH:\$PATH"
ENV CPPPATH="/usr/src/imagemagick/include:$CPPPATH"
ENV CPATH="/usr/src/imagemagick/include:$CPATH"
ENV LIBRARY_PATH="/usr/src/imagemagick/lib:$LIBRARY_PATH"
ENV LD_LIBRARY_PATH="/usr/src/imagemagick/lib:$LD_LIBRARY_PATH"
# Remove libwebp from heroku image
RUN apt-get remove -y libwebp6 libwebpdemux2 libwebpmux3
RUN ldconfig /usr/src/imagemagick/lib/
RUN cd /usr/src/ \
&& wget https://imagemagick.org/download/releases/ImageMagick-7.1.0-22.tar.gz \
&& tar xf ImageMagick-7.1.0-22.tar.gz \
&& cd ImageMagick-7* \
&& ./configure --with-heic=yes --with-webp=yes --prefix=/usr/src/imagemagick \
&& make \
&& make install
RUN curl -L http://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2.tar.gz | tar zx \
&& cd libwebp-1.2.2 \
&& ./configure --prefix=/usr/src/imagemagick \
&& make \
&& make install
# RUN cp /usr/local/lib/libde265.so.0 /usr/src/imagemagick/lib \
# && cp /usr/local/lib/libheif.so.1 /usr/src/imagemagick/lib \
# && cp /usr/local/lib/libwebp.so.7 /usr/src/imagemagick/lib
# # clean the build area ready for packaging
# RUN cd /usr/src/imagemagick \
# && strip lib/*.a lib/lib*.so*
RUN cd /usr/src/imagemagick \
&& rm -rf build \
&& mkdir build \
&& tar czf \
/usr/src/imagemagick/build/imagemagick.tar.gz bin include lib
CMD ["tail", "-f", "/dev/null"]