-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
51 lines (34 loc) · 1.05 KB
/
Dockerfile
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
41
42
43
44
45
46
47
48
49
50
51
ARG PG_MAJOR
FROM postgres:${PG_MAJOR}
RUN apt-get update
ENV build_deps ca-certificates \
git \
build-essential \
libpq-dev \
postgresql-server-dev-${PG_MAJOR} \
curl \
libreadline6-dev \
zlib1g-dev
RUN apt-get install -y --no-install-recommends $build_deps pkg-config cmake
WORKDIR /home/postgres
ENV HOME=/home/postgres
ENV PATH=/home/postgres/.cargo/bin:$PATH
RUN chown postgres:postgres /home/postgres
USER postgres
RUN \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal --default-toolchain 1.78.0 && \
rustup --version && \
rustc --version && \
cargo --version
# pgrx
RUN cargo install cargo-pgrx --version 0.11.4 --locked
RUN cargo pgrx init --pg${PG_MAJOR} $(which pg_config)
USER root
COPY . .
RUN cargo pgrx install
RUN chown -R postgres:postgres /home/postgres
RUN chown -R postgres:postgres /usr/share/postgresql/${PG_MAJOR}/extension
RUN chown -R postgres:postgres /usr/lib/postgresql/${PG_MAJOR}/lib
USER postgres
ENV POSTGRES_HOST_AUTH_METHOD=trust
ENV USER=postgres