blob: 0e12c8feb09f701654d2c9f7f8373f80ee7e8b7d (
plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# See https://gitlab.com/sequoia-pgp/sequoia/-/blob/main/README.md#debian
# for system requirements
FROM debian:bullseye AS build
# create a sandbox user for the build (in ~builder) and install (in /opt)
# give it permissions to the build dir and home
# upgrade everything
# add dependencies, as specified by the Sequoia README.md file
RUN groupadd builder && \
useradd --no-log-init --create-home --gid builder builder && \
apt-get update && \
apt-get upgrade --assume-yes && \
apt-get install --assume-yes --no-install-recommends \
ca-certificates \
capnproto \
cargo \
git \
libclang-dev \
libsqlite3-dev \
libssl-dev \
make \
nettle-dev \
pkg-config \
python3-dev \
python3-setuptools \
python3-cffi \
python3-pytest \
rustc \
&& \
apt-get clean && \
chown builder /opt
COPY --chown=builder:builder . /home/builder/sequoia
# switch to the sandbox user
USER builder
# retry build because cargo sometimes segfaults during download (#918854)
#
# the `build-release` target is used instead of the default because
# `install` calls it after anyways
RUN cd /home/builder/sequoia && \
CARGO_TARGET_DIR=target cargo build -p sequoia-sqv --release && \
CARGO_TARGET_DIR=target cargo build -p sequoia-sq --release && \
install --strip -D --target-directory /opt/usr/local/bin \
target/release/sq \
target/release/sqv
FROM debian:bullseye-slim AS sq-base
RUN groupadd user && \
useradd --no-log-init -g user user && \
mkdir /home/user && \
chown -R user:user /home/user && \
apt-get update && \
apt-get upgrade --assume-yes && \
apt-get install --assume-yes ca-certificates libssl1.1 libsqlite3-0 && \
apt-get clean && \
rm -fr -- /var/lib/apt/lists/* /var/cache/*
FROM sq-base AS sqv
COPY --from=build /opt/usr/local/bin/sqv /usr/local/bin/sqv
USER user
WORKDIR /home/user
ENTRYPOINT ["/usr/local/bin/sqv"]
CMD ["--help"]
FROM sq-base AS sq
COPY --from=build /opt/usr/local/bin/sq /usr/local/bin/sq
COPY --from=build /etc/ssl/certs /etc/ssl/certs
ENTRYPOINT ["/usr/local/bin/sq"]
|