-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 894 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (24 loc) · 894 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
ARG BUILDER_BASE=ghcr.io/pgdogdev/pgdog-base-builder:latest
ARG RUNTIME_BASE=ghcr.io/pgdogdev/pgdog-base-runtime:latest
FROM ${BUILDER_BASE} AS builder
ARG FEATURES=""
COPY . /build
COPY .git /build/.git
WORKDIR /build
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN source ~/.cargo/env && \
cargo_features=(); \
if [ -n "${FEATURES}" ]; then \
cargo_features=(--no-default-features --features "${FEATURES}"); \
fi && \
cd pgdog && \
cargo build --release "${cargo_features[@]}" && \
cd .. && \
cargo build --release -p pgdog-primary-only-tables "${cargo_features[@]}"
FROM ${RUNTIME_BASE}
ENV RUST_LOG=info
COPY --from=builder /build/target/release/pgdog /usr/local/bin/pgdog
COPY --from=builder /build/target/release/libpgdog_primary_only_tables.so /usr/lib/libpgdog_primary_only_tables.so
WORKDIR /pgdog
STOPSIGNAL SIGINT
CMD ["/usr/local/bin/pgdog"]