forked from supabase/edge-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (28 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
41 lines (28 loc) · 1.23 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
# syntax=docker/dockerfile:1.4
FROM rust:1.79.0-bookworm as builder
ARG TARGETPLATFORM
ARG GIT_V_TAG
ARG PROFILE=release
ARG FEATURES
RUN apt-get update && apt-get install -y llvm-dev libclang-dev clang cmake binutils
WORKDIR /usr/src/edge-runtime
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry,id=${TARGETPLATFORM} --mount=type=cache,target=/usr/src/edge-runtime/target,id=${TARGETPLATFORM} \
GIT_V_TAG=${GIT_V_TAG} cargo build --profile ${PROFILE} --features "${FEATURES}" && \
mv /usr/src/edge-runtime/target/${PROFILE}/edge-runtime /root
RUN objcopy --compress-debug-sections \
--only-keep-debug \
/root/edge-runtime \
/root/edge-runtime.debug
RUN objcopy --strip-debug \
--add-gnu-debuglink=/root/edge-runtime.debug \
/root/edge-runtime
# Application runtime
FROM debian:bookworm-slim as edge-runtime
RUN apt-get update && apt-get install -y libssl-dev \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /root/edge-runtime /usr/local/bin/edge-runtime
COPY --from=builder /root/edge-runtime.debug /usr/local/bin/edge-runtime.debug
COPY examples/main /opt/edge-runtime/examples/main
RUN mkdir -p /eszip
ENTRYPOINT ["edge-runtime", "start", "--main-service", "/opt/edge-runtime/examples/main"]