-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (32 loc) · 976 Bytes
/
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
ARG SRC="https://github.com/nih-at/libzip.git"
ARG VER="v1.9.2"
ARG OWNER=manarth
ARG REPO=libzip-static
FROM alpine:3.16 as build
ARG SRC
ARG VER
RUN apk add autoconf automake bison cmake g++ gcc git libc-dev libtool make mbedtls-static re2c samurai zlib-dev
RUN mkdir /opt/libzip
WORKDIR /opt/libzip
RUN git clone --depth 1 --branch ${VER} ${SRC} /opt/libzip
RUN cmake -B build -G Ninja \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DENABLE_BZIP2=ON \
-DENABLE_LZMA=ON \
-DENABLE_OPENSSL=ON \
-DENABLE_ZSTD=ON \
-DCMAKE_BUILD_TYPE=MinSizeRel
RUN cmake --build build
# Package to a minimal release.
FROM scratch as dist
ARG SRC
ARG VER
ARG OWNER
ARG REPO
LABEL libzip.source=${SRC}
LABEL libzip.version=${VER}
LABEL org.opencontainers.image.source https://github.com/${OWNER}/${REPO}
STOPSIGNAL SIGTERM
COPY --from=build //opt/libzip/build/lib/libzip.a /lib/libzip.a