-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (52 loc) · 1.95 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
# syntax=docker/dockerfile:1
# bump: openjpeg /OPENJPEG_VERSION=([\d.]+)/ https://github.com/uclouvain/openjpeg.git|*
# bump: openjpeg after ./hashupdate Dockerfile OPENJPEG $LATEST
# bump: openjpeg link "CHANGELOG" https://github.com/uclouvain/openjpeg/blob/master/CHANGELOG.md
ARG OPENJPEG_VERSION=2.5.0
ARG OPENJPEG_URL="https://github.com/uclouvain/openjpeg/archive/v$OPENJPEG_VERSION.tar.gz"
ARG OPENJPEG_SHA256=0333806d6adecc6f7a91243b2b839ff4d2053823634d4f6ed7a59bc87409122a
# Must be specified
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION} AS base
FROM base AS download
ARG OPENJPEG_URL
ARG OPENJPEG_SHA256
ARG WGET_OPTS="--retry-on-host-error --retry-on-http-error=429,500,502,503 -nv"
WORKDIR /tmp
RUN \
apk add --no-cache --virtual download \
coreutils wget tar && \
wget $WGET_OPTS -O openjpeg.tar.gz "$OPENJPEG_URL" && \
echo "$OPENJPEG_SHA256 openjpeg.tar.gz" | sha256sum --status -c - && \
mkdir openjpeg && \
tar xf openjpeg.tar.gz -C openjpeg --strip-components=1 && \
rm openjpeg.tar.gz && \
apk del download
FROM base AS build
COPY --from=download /tmp/openjpeg/ /tmp/openjpeg/
WORKDIR /tmp/openjpeg/build
RUN \
apk add --no-cache --virtual build \
build-base cmake pkgconf && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_PKGCONFIG_FILES=ON \
-DBUILD_CODEC=OFF \
-DWITH_ASTYLE=OFF \
-DBUILD_TESTING=OFF \
.. && \
make -j$(nproc) install && \
# Sanity tests
pkg-config --exists --modversion --path libopenjp2 && \
ar -t /usr/local/lib/libopenjp2.a && \
readelf -h /usr/local/lib/libopenjp2.a && \
# Cleanup
apk del build
FROM scratch
ARG OPENJPEG_VERSION
COPY --from=build /usr/local/lib/pkgconfig/libopenjp2.pc /usr/local/lib/pkgconfig/libopenjp2.pc
COPY --from=build /usr/local/lib/libopenjp2.a /usr/local/lib/libopenjp2.a
COPY --from=build /usr/local/include/openjpeg-2.5/ /usr/local/include/openjpeg-2.5/