summaryrefslogtreecommitdiff
path: root/slcl/0.4.0/Dockerfile
blob: 673e7b45fd7b46d14899ad6412371e66f7cdcfbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM alpine as base
RUN apk update && apk add \
	git \
	cmake \
	make \
	gcc \
	pkgconf \
	musl-dev
COPY --from=zlib:1.3.1 /opt/spm/zlib-1.3.1/ /usr/local/
COPY --from=libcjson:1.7.18 /opt/spm/cjson-1.7.18/ /usr/local/
COPY --from=libsodium:1.0.20 /opt/spm/libsodium-1.0.20/ /usr/local/
ARG PREFIX=/opt/spm/slcl-0.4.0
RUN git clone --depth 1 -b v0.4.0 --recursive \
	https://gitea.privatedns.org/xavi/slcl
WORKDIR /slcl
RUN LDFLAGS='-static -Wl,--gc-sections' cmake -B build \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=$PREFIX
RUN cmake --build build -j$(nproc)
RUN cmake --install build
WORKDIR $PREFIX/bin
RUN strip slcl
FROM scratch
COPY --from=base /opt/spm/slcl-0.4.0/bin/slcl /opt/spm/slcl-0.4.0/bin/slcl