summaryrefslogtreecommitdiff
path: root/cJSON/1.7.18/Dockerfile
blob: f83aad47db653b1a0443b68540e7972b554abbc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM alpine as base
ARG PREFIX=/usr/local
ARG DESTDIR=/opt/spm/cjson-1.7.18
RUN apk update && apk add \
	git \
	cmake \
	make \
	gcc \
	musl-dev
RUN git clone --depth 1 -b v1.7.18 https://github.com/DaveGamble/cJSON
WORKDIR /cJSON
RUN cmake -B build \
	-DCMAKE_BUILD_TYPE=Release \
	-DBUILD_SHARED_LIBS=OFF \
	-DCMAKE_C_FLAGS="-ffunction-sections -fdata-sections"
RUN cmake --build build/ --parallel $(nproc --all)
WORKDIR build
RUN make install DESTDIR=$DESTDIR
FROM scratch
COPY --from=base /opt/spm/cjson-1.7.18/usr/local /opt/spm/cjson-1.7.18