-
Notifications
You must be signed in to change notification settings - Fork 2
/
Containerfile
26 lines (24 loc) · 1.03 KB
/
Containerfile
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
ARG PENUMBRA_VERSION=main
# ARG PENUMBRA_VERSION=v0.54.1
# Pull from Penumbra container, so we can grab a recent `pcli` without
# needing to compile from source.
FROM ghcr.io/penumbra-zone/penumbra:${PENUMBRA_VERSION} AS penumbra
# Build the osiris binary
FROM docker.io/rust:1-bookworm AS builder
ARG PENUMBRA_VERSION=main
RUN apt-get update && apt-get install -y \
libssl-dev git-lfs clang
# Clone in Penumbra deps to relative path, required due to git-lfs.
RUN git clone --depth 1 --branch "${PENUMBRA_VERSION}" https://github.com/penumbra-zone/penumbra /usr/src/penumbra
COPY . /usr/src/osiris
WORKDIR /usr/src/osiris
RUN cargo build --release
# Runtime container, copying in built artifacts
FROM docker.io/debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates
RUN groupadd --gid 1000 penumbra \
&& useradd -m -d /home/penumbra -g 1000 -u 1000 penumbra
COPY --from=penumbra /bin/pcli /usr/bin/pcli
COPY --from=builder /usr/src/osiris/target/release/osiris /usr/bin/osiris
WORKDIR /home/penumbra
USER penumbra