-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
43 lines (30 loc) · 1.01 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
40
41
42
43
# syntax=docker/dockerfile:1
# Build stage — runs under QEMU for non-native platforms (e.g. arm64 on amd64 CI)
FROM rust:1-alpine AS builder
RUN apk add --no-cache git musl-dev
# squic-rust is a sibling workspace dependency (path = "../../../squic-rust" from crates/bti)
RUN git clone --depth 1 https://github.com/wave-cl/squic-rust.git /squic-rust
WORKDIR /build
COPY . .
RUN cargo build --release --locked
RUN cp target/release/bti /bti
# Minimal user/group (UID/GID 6880)
RUN printf 'bti:x:6880:6880:bti:/:/sbin/nologin\n' > /tmp/passwd && \
printf 'bti:x:6880:\n' > /tmp/group
# Assemble root-fs in a single layer
FROM alpine AS rootfs
COPY --from=builder /bti /rootfs/bti
COPY --from=builder /tmp/passwd /rootfs/etc/passwd
COPY --from=builder /tmp/group /rootfs/etc/group
# Final minimal scratch image
FROM scratch
COPY --from=rootfs /rootfs /
USER bti:bti
VOLUME ["/data"]
ENV BTI_DB_PATH=/data/db \
LOG_LEVEL=info
EXPOSE 8080
EXPOSE 6880/udp
EXPOSE 6881/udp
ENTRYPOINT ["/bti"]
CMD ["web", "--crawl"]