-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
40 lines (31 loc) · 1.28 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
FROM ubuntu:latest AS builder
RUN apt update && \
apt install -y build-essential cmake clang curl pkg-config libssl-dev git mold
# Install Rust.
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
COPY . /build
COPY .git /build/.git
WORKDIR /build
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN source ~/.cargo/env && \
if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then \
export RUSTFLAGS="-Ctarget-feature=+lse"; \
fi && \
cd pgdog && \
cargo build --release
FROM ubuntu:latest
ENV RUST_LOG=info
ARG PSQL_VERSION=18
ENV PSQL_VERSION=${PSQL_VERSION}
RUN apt update && \
apt install -y curl ca-certificates ssl-cert && \
update-ca-certificates
RUN install -d /usr/share/postgresql-common/pgdg && \
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc && \
. /etc/os-release && \
sh -c "echo 'deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $VERSION_CODENAME-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
RUN apt update && apt install -y postgresql-client-${PSQL_VERSION}
COPY --from=builder /build/target/release/pgdog /usr/local/bin/pgdog
WORKDIR /pgdog
STOPSIGNAL SIGINT
CMD ["/usr/local/bin/pgdog"]