-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.alpine
33 lines (26 loc) · 1.03 KB
/
Dockerfile.alpine
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
FROM athes/swflib:alpine as build-stage
ARG CMAKE_BUILD_TYPE=Release
ARG SWFLIB_STATIC=ON
# Increase the default thread stack size to 8 MB as the default is not enough on alpine
ARG LDFLAGS -Wl,-z,stack-size=8388608
# Build & install mimalloc, since musl's allocator is terrible
WORKDIR /src
RUN git clone --depth 1 https://github.com/microsoft/mimalloc && \
mkdir mimalloc/build && cd mimalloc/build && \
cmake .. -DMI_BUILD_STATIC=OFF -DMI_BUILD_OBJECT=OFF -DMI_BUILD_TESTS=OFF && \
cmake --build . && \
cmake --install . --strip
WORKDIR /src/detfm
COPY . .
WORKDIR /build/detfm
RUN cmake /src/detfm -DSWFLIB_STATIC=$SWFLIB_STATIC && \
cmake --build . && \
cmake --install . --strip
FROM athes/unpacker:alpine
WORKDIR /app
# Get mimalloc from build stage and use it
COPY --from=build-stage /usr/local/lib/libmimalloc.so /lib/libmimalloc.so
ENV LD_PRELOAD=/lib/libmimalloc.so
COPY --from=build-stage /usr/local/lib/swflib.so /usr/local/lib/
COPY --from=build-stage /usr/local/bin/detfm /usr/local/bin/
COPY classdef ./classdef