-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 1.07 KB
/
Copy pathDockerfile
File metadata and controls
33 lines (24 loc) · 1.07 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
FROM rust:1-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends gcc make && \
rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
RUN cargo build --release && \
./target/release/pith build self-host/pith_main.pith && \
./target/release/pith build self-host/ir_driver.pith
# ---
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates gcc libc6 && \
rm -rf /var/lib/apt/lists/* && \
groupadd -g 1000 pith && \
useradd -m -u 1000 -g pith pith
COPY --from=builder /src/target/release/pith /usr/local/bin/pith
COPY --from=builder /src/target/release/libpith_runtime.a /usr/local/lib/pith/libpith_runtime.a
COPY --from=builder /src/self-host/pith_main /opt/pith/self-host/pith_main
COPY --from=builder /src/self-host/ir_driver /opt/pith/self-host/ir_driver
COPY --from=builder /src/std /opt/pith/std
ENV PITH_RUNTIME_LIB=/usr/local/lib/pith/libpith_runtime.a
ENV PITH_SELF_HOST=/opt/pith/self-host/pith_main
ENV PITH_IR_DRIVER=/opt/pith/self-host/ir_driver
USER pith
ENTRYPOINT ["pith"]