-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (35 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
46 lines (35 loc) · 1.03 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
44
45
46
# ---------------- RUST BUILD ----------------
FROM rust:1.89 AS rust-builder
WORKDIR /workspace
COPY rustCode ./rustCode
WORKDIR /workspace/rustCode
RUN cargo build --release
#--------------- GO BUILD --------------------
FROM golang:1.25 AS go-builder
WORKDIR /workspace
COPY goCode ./goCode
# Rust shared lib
COPY --from=rust-builder \
/workspace/rustCode/target/release/librpc.so \
/workspace/goCode/libs/librpc.so
WORKDIR /workspace/goCode/goApp
ENV CGO_ENABLED=1
RUN go build -o app
# ------------------ RUNTIME -----------
FROM ubuntu:24.04
WORKDIR /workspace
RUN apt-get update && apt-get install -y \
ca-certificates \
libc6 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=go-builder \
/workspace/goCode/goApp/app \
/workspace/goCode/goApp/app
COPY --from=rust-builder \
/workspace/rustCode/target/release/rustCode \
/workspace/rustCode/rust-app
# Shared lib
COPY --from=go-builder \
/workspace/goCode/libs/librpc.so \
/workspace/goCode/libs/librpc.so
ENV LD_LIBRARY_PATH=/workspace/goCode/libs