-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
38 lines (37 loc) · 1.25 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
FROM notcompsky/static-wangle-ffmpeg-opencv:latest AS intermediate
WORKDIR /bpcs
COPY CMakeLists.txt /bpcs/CMakeLists.txt
COPY src /bpcs/src
ARG target=linux-x64
RUN git clone --depth 1 https://github.com/NotCompsky/libcompsky \
&& mv libcompsky/include/compsky /usr/local/include/compsky \
\
&& mkdir /bpcs/build \
&& mkdir /bpcs-bin \
&& for buildtype in Release Debug RelWithDebInfo MinSizeRel; do \
( mkdir "/bpcs/build/$buildtype" \
&& cd "/bpcs/build/$buildtype" \
&& cmake \
-DCMAKE_BUILD_TYPE="$buildtype" \
-DNATIVE_MARCH=OFF \
-DENABLE_STATIC=ON \
-DBUILD_DOCS=OFF \
-DENABLE_EXCEPTS=$(if [ $buildtype = Release ]; then echo OFF; else echo ON; fi) \
-DCHITTY_CHATTY=$(if [ $buildtype = Debug ]; then echo ON; else echo OFF; fi) \
-DENABLE_RUNTIME_TESTS=$(if [ $buildtype = Release ]; then echo OFF; else echo ON; fi) \
-DMALLOC_OVERRIDE=/mimalloc-override.o \
../.. \
&& make \
&& echo "Build Type: $buildtype" \
&& ls -l bpcs* \
&& strip -s bpcs* \
&& ls -l bpcs* \
&& sha1sum bpcs* \
&& for f in bpcs bpcs-x bpcs-count bpcs-fmt; do \
mv "$f" "/bpcs-bin/${target}_${buildtype}_${f}"; \
done \
); done
FROM alpine:latest
WORKDIR /bpcs
COPY --from=intermediate /bpcs-bin/* /bpcs/
ENTRYPOINT [ "/bin/sh" ]