-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
35 lines (26 loc) · 1.27 KB
/
Dockerfile
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
FROM public.ecr.aws/r5b3e0r5/3box/rust-builder:latest as builder
RUN mkdir -p /home/builder/rust-ceramic
WORKDIR /home/builder/rust-ceramic
# Define the type of build to make. One of release or debug.
ARG BUILD_MODE=release
# Copy in source code
COPY . .
# Build application using a docker cache
# To clear the cache use:
# docker builder prune --filter type=exec.cachemount
RUN --mount=type=cache,target=/home/builder/.cargo \
--mount=type=cache,target=/home/builder/rust-ceramic/target \
make $BUILD_MODE && \
cp ./target/$BUILD_MODE/ceramic-one ./
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install ca-certificates -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /home/builder/rust-ceramic/ceramic-one /usr/bin
# Adding this step after copying the ceramic-one binary so that we always take the newest libs from the builder if the
# main binary has changed. Updated dependencies will result in an updated binary, which in turn will result in the
# latest versions of the dependencies being pulled from the builder.
COPY --from=builder /usr/lib/*-linux-gnu*/libsqlite3.so* /usr/lib/
COPY --from=builder /usr/lib/*-linux-gnu*/libssl.so* /usr/lib/
COPY --from=builder /usr/lib/*-linux-gnu*/libcrypto.so* /usr/lib/
ENTRYPOINT ["/usr/bin/ceramic-one", "daemon"]