forked from br2490/isle-imageservices
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
129 lines (118 loc) · 5.8 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
FROM islandoracollabgroup/isle-tomcat:1.5.28
# Set up environmental variables for Tomcat, Cantaloupe & dependencies
# @see: Cantaloupe https://github.com/cantaloupe-project/cantaloupe/releases
# @see: ImageMagick https://github.com/ImageMagick/ImageMagick/releases
ENV JAVA_MAX_MEM=${JAVA_MAX_MEM:-2G} \
JAVA_MIN_MEM=${JAVA_MIN_MEM:-0} \
CANTALOUPE_VERSION=${CANTALOUPE_VERSION:-4.1.11} \
IMAGEMAGICK_VERSION=${IMAGEMAGICK_VERSION:-7.1.1-25} \
OPENJPEG_VERSION=${OPENJPEG_VERSION:-v2.5.0} \
JAVA_OPTS='-Djava.awt.headless=true -server -Xmx${JAVA_MAX_MEM} -Xms${JAVA_MIN_MEM} -XX:+UseG1GC -XX:+UseStringDeduplication -XX:MaxGCPauseMillis=200 -XX:InitiatingHeapOccupancyPercent=70 -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true' \
KAKADU_HOME=/usr/local/cantaloupe/deps/Linux-x86-64/bin \
KAKADU_LIBRARY_PATH=/usr/local/cantaloupe/deps/Linux-x86-64/lib \
CATALINA_OPTS="-Dcantaloupe.config=/usr/local/cantaloupe/cantaloupe.properties \
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true \
-Dkakadu.home=/usr/local/cantaloupe/deps/Linux-x86-64/bin \
-Djava.library.path=/usr/local/cantaloupe/deps/Linux-x86-64/lib:/usr/local/lib:/usr/local/tomcat/lib \
-DLD_LIBRARY_PATH=/usr/local/cantaloupe/deps/Linux-x86-64/lib:/usr/local/lib:/usr/local/tomcat/lib" \
CANTALOUPE_PROCESSOR_SELECTION_STRATEGY=${CANTALOUPE_PROCESSOR_SELECTION_STRATEGY:-ManualSelectionStrategy} \
CANTALOUPE_PROCESSOR_JP2=${CANTALOUPE_PROCESSOR_JP2:-OpenJpegProcessor}
## Dependencies
RUN GEN_DEP_PACKS="ffmpeg \
ffmpeg2theora \
libavcodec-extra \
ghostscript \
poppler-utils" && \
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
apt-get update && \
apt-get install -y --no-install-recommends $GEN_DEP_PACKS && \
## Cleanup phase.
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
## ImageMagick and OpenJPG
# @see: ImageMagick https://github.com/ImageMagick/ImageMagick/releases & OpenJPG https://github.com/uclouvain/openjpeg/releases
RUN BUILD_DEPS="build-essential \
cmake \
pkg-config \
libtool" && \
IMAGEMAGICK_LIBS="libbz2-dev \
libdjvulibre-dev \
libexif-dev \
libgif-dev \
libjpeg8 \
libjpeg-dev \
liblqr-dev \
libopenexr-dev \
libopenjp2-7-dev \
libpng-dev \
libraw-dev \
librsvg2-dev \
libtiff-dev \
libzstd-dev \
libwmf-dev \
libwebp-dev \
libwmf-dev \
libltdl-dev \
zlib1g-dev" && \
## I believe these are unused and actually install by libavcodec-extra.
IMAGEMAGICK_LIBS_EXTENDED="libfontconfig \
libfreetype6-dev" && \
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
apt-get update && \
apt-get install -y --no-install-recommends -o APT::Get::Install-Automatic=true $BUILD_DEPS && \
apt-mark auto $BUILD_DEPS && \
apt-get install -y --no-install-recommends $IMAGEMAGICK_LIBS && \
cd /tmp && \
git clone -b $OPENJPEG_VERSION https://github.com/uclouvain/openjpeg && \
cd openjpeg && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make && \
make install && \
ldconfig && \
cd /tmp && \
curl -O -L https://github.com/ImageMagick/ImageMagick/archive/$IMAGEMAGICK_VERSION.tar.gz && \
tar xf $IMAGEMAGICK_VERSION.tar.gz && \
cd ImageMagick-$IMAGEMAGICK_VERSION && \
./configure --enable-hdri --with-quantum-depth=16 --without-magick-plus-plus --without-perl --with-rsvg && \
make && \
make install && \
ldconfig && \
## Cleanup phase.
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
## Cantaloupe
RUN cd /tmp && \
curl -O -L https://github.com/medusa-project/cantaloupe/releases/download/v$CANTALOUPE_VERSION/cantaloupe-$CANTALOUPE_VERSION.zip && \
unzip cantaloupe-$CANTALOUPE_VERSION.zip && \
rm cantaloupe-$CANTALOUPE_VERSION/*.sample && \
mkdir -p /usr/local/cantaloupe /usr/local/cantaloupe/temp /usr/local/cantaloupe/cache /usr/local/tomcat/logs/cantaloupe && \
cp -r cantaloupe-$CANTALOUPE_VERSION/* /usr/local/cantaloupe && \
# Uncomment here to use the Kakadu demo or licensed processor
chmod 755 /usr/local/cantaloupe/deps/Linux-x86-64/bin/kdu_expand && \
ln -s /usr/local/cantaloupe/deps/Linux-x86-64/bin/kdu_expand /usr/local/bin/kdu_expand && \
ln -s /usr/local/cantaloupe/deps/Linux-x86-64/lib/libkdu_a7AR.so /usr/local/lib/libkdu_a7AR.so && \
ln -s /usr/local/cantaloupe/deps/Linux-x86-64/lib/libkdu_jni.so /usr/local/lib/libkdu_jni.so && \
ln -s /usr/local/cantaloupe/deps/Linux-x86-64/lib/libkdu_v7AR.so /usr/local/lib/libkdu_v7AR.so && \
mv /usr/local/cantaloupe/cantaloupe-$CANTALOUPE_VERSION.war /usr/local/tomcat/webapps/cantaloupe.war && \
unzip /usr/local/tomcat/webapps/cantaloupe.war -d /usr/local/tomcat/webapps/cantaloupe && \
chown tomcat /usr/local/cantaloupe -R && \
## Cleanup Phase.
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Labels
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="ISLE Image Services" \
org.label-schema.description="Serving all your images needs with IIIF & Cantaloupe." \
org.label-schema.url="https://islandora-collaboration-group.github.io" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/Islandora-Collaboration-Group/isle-imageservices" \
org.label-schema.vendor="Islandora Collaboration Group (ICG) - [email protected]" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
traefik.port="8080"
COPY rootfs /
EXPOSE 8080
ENTRYPOINT ["/init"]