forked from epoupon/fileshelter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-build-alpine
37 lines (31 loc) · 1.03 KB
/
Dockerfile-build-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
34
35
36
37
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM alpine:3.18
ARG BUILD_PACKAGES="\
clang \
make \
cmake \
lld \
pkgconfig"
RUN apk add --no-cache ${BUILD_PACKAGES}
ARG FILESHELTER_BUILD_PACKAGES=" \
gcc \
g++ \
musl-dev \
boost-dev \
libconfig-dev \
libarchive-dev \
wt-dev \
gtest-dev"
COPY --from=xx / /
ARG TARGETPLATFORM
RUN xx-apk add --no-scripts --no-cache ${FILESHELTER_BUILD_PACKAGES}
# FILESHELTER
COPY . /tmp/fileshelter/
ARG FILESHELTER_BUILD_TYPE="Release"
RUN \
DIR=/tmp/fileshelter/build && mkdir -p ${DIR} && cd ${DIR} && \
xx-info is-cross && export BUILD_TESTS=OFF || export BUILD_TESTS=ON && \
PKG_CONFIG_PATH=/$(xx-info)/usr/lib/pkgconfig cmake /tmp/fileshelter/ -DCMAKE_INCLUDE_PATH=${PREFIX}/include -DCMAKE_BUILD_TYPE=${FILESHELTER_BUILD_TYPE} $(xx-clang --print-cmake-defines) -DCMAKE_PREFIX_PATH=/$(xx-info)/usr/lib/cmake -DBUILD_TESTING=${BUILD_TESTS} && \
VERBOSE=1 make -j$(nproc) && \
xx-verify src/fileshelter/fileshelter && \
(xx-info is-cross || make test)