-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathDockerfile.amd64
More file actions
28 lines (18 loc) · 925 Bytes
/
Dockerfile.amd64
File metadata and controls
28 lines (18 loc) · 925 Bytes
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
# Build command: docker build -f Dockerfile.amd64 --platform linux/amd64 -t moonlink-deployment:latest .
# TODO(hjiang): Use release build for docker images, update after official release.
# Build base image for compilation and linking.
FROM mcr.microsoft.com/devcontainers/rust:latest AS builder
WORKDIR /workspace
COPY . .
RUN apt-get update && apt-get install -y gcc-x86-64-linux-gnu
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc
RUN rustup target add x86_64-unknown-linux-gnu
RUN cargo build --target x86_64-unknown-linux-gnu --verbose
# Use a slim image for docker image used for cloud deployment.
FROM ubuntu:24.04
RUN apt-get update && \
apt-get install -y ca-certificates libssl3 libpq5 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /workspace/target/x86_64-unknown-linux-gnu/debug/moonlink_service .
ENTRYPOINT ["/app/moonlink_service", "/tmp/moonlink"]