-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile.pkg
More file actions
39 lines (33 loc) · 1.14 KB
/
Dockerfile.pkg
File metadata and controls
39 lines (33 loc) · 1.14 KB
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
39
ARG ASAN_TAG
ARG DEBIAN_RELEASE=trixie
ARG RSPAMD_GIT
ARG RSPAMD_VERSION
ARG TARGETARCH
FROM ghcr.io/rspamd/rspamd-build-docker:debian-${DEBIAN_RELEASE} AS build
RUN mkdir /build /deb && chown nobody:nogroup /build /deb \
&& apt-get update \
&& apt-get install -y libfasttext-dev
ARG RSPAMD_GIT
ARG RSPAMD_VERSION
ENV RSPAMD_GIT=$RSPAMD_GIT
ENV RSPAMD_VERSION=$RSPAMD_VERSION
USER nobody
WORKDIR /build
COPY patches/ /patches/
RUN git clone -b ${RSPAMD_GIT} https://github.com/rspamd/rspamd.git \
&& cd rspamd \
&& git apply /patches/*.diff \
&& if [ "${RSPAMD_VERSION}" = "auto" ]; then \
VDESC="$(git describe --tags --always | tr - +)+nightly$(date -u +%Y%m%d)"; \
echo "Nightly version: ${VDESC}"; \
sed -i "s/(.*)/(${VDESC})/" debian/changelog; \
else \
sed -i "s/(.*)/(${RSPAMD_VERSION})/" debian/changelog; \
fi \
&& sed -i "s/^EXTRA_ARGS :=.*/EXTRA_ARGS := -DGIT_ID=$(git rev-parse --short HEAD)/" debian/rules \
&& sed -i s/quilt/native/ debian/source/format \
&& debuild -us -uc \
&& mv /build/*.deb /deb/ \
&& touch -h -d '2000-01-01 00:00:00' /deb/ /deb/*
FROM scratch AS pkg
COPY --from=build /deb /deb