-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 862 Bytes
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 862 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
29
30
31
32
33
34
35
36
37
38
39
40
FROM rust:1-bullseye AS builder
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y \
build-essential \
pkg-config \
libpq-dev \
protobuf-compiler \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
COPY Cargo.toml Cargo.lock ./
# Empty main.rs to build dependencies on a separate layer
RUN mkdir -p src && echo "fn main() {}" > src/main.rs
RUN cargo build --release
# Copy actual source code
COPY src ./src
COPY proto ./proto
COPY build.rs ./
RUN cargo build --release
RUN strip target/release/walstream
RUN cp target/release/walstream /walstream-$TARGETARCH
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y \
libpq5 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /walstream-$TARGETARCH /usr/local/bin/walstream
ENTRYPOINT ["/usr/local/bin/walstream"]
CMD ["--help"]