35 lines
879 B
Docker
35 lines
879 B
Docker
FROM rust:alpine AS builder
|
|
|
|
ARG PGCAT_VERSION=1.1.1
|
|
|
|
RUN set -euxo pipefail &&\
|
|
apk --no-cache upgrade &&\
|
|
apk --no-cache add \
|
|
git \
|
|
musl-dev \
|
|
build-base \
|
|
&&\
|
|
cd /tmp &&\
|
|
git clone --branch=v${PGCAT_VERSION} --depth=1 https://github.com/postgresml/pgcat.git &&\
|
|
cd pgcat &&\
|
|
cargo build --release
|
|
|
|
FROM danielberteaud/alpine:24.4-1
|
|
MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
|
|
|
|
ENV PGCAT_CONF_DIR=/etc/pgcat \
|
|
LANG=fr_FR.utf8 \
|
|
TZ=Europe/Paris \
|
|
RUST_LOG=info
|
|
|
|
RUN set -euxo pipefail &&\
|
|
addgroup -g 6432 pgcat &&\
|
|
adduser --system --ingroup pgcat --disabled-password --uid 6432 --home /tmp --shell /sbin/nologin pgcat
|
|
|
|
COPY --from=builder /tmp/pgcat/target/release/pgcat /usr/local/bin/pgcat
|
|
COPY --from=builder /tmp/pgcat/pgcat.toml /etc/pgcat/pgcat.toml
|
|
|
|
USER pgcat
|
|
WORKDIR ${PGCAT_CONF_DIR}
|
|
CMD ["pgcat"]
|