generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
51 lines (40 loc) · 1.96 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
FROM postgis/postgis:15-3.3 AS build
ENV PLUGIN_VERSION=v2.2.0.CR1
ENV PROTOC_VERSION=1.4
# Install the packages which will be required to get everything to compile
RUN apt-get update \
&& apt-get install -f -y --no-install-recommends \
software-properties-common \
build-essential \
pkg-config \
git \
postgresql-server-dev-$PG_MAJOR \
clang-11 \
llvm-11 \
&& add-apt-repository "deb http://ftp.debian.org/debian testing main contrib" \
&& apt-get update && apt-get install -f -y --no-install-recommends \
libprotobuf-c-dev=$PROTOC_VERSION.* \
&& rm -rf /var/lib/apt/lists/*
# Compile the plugin from sources and install it
RUN git clone https://github.com/debezium/postgres-decoderbufs -b $PLUGIN_VERSION --single-branch \
&& cd /postgres-decoderbufs \
&& make && make install \
&& cd / \
&& rm -rf postgres-decoderbufs
FROM postgis/postgis:15-3.3
LABEL maintainer="Team ADA"
RUN apt-get update \
&& apt-get install -f -y --no-install-recommends \
software-properties-common \
&& add-apt-repository "deb http://ftp.debian.org/debian testing main contrib" \
&& apt-get update && apt-get install -f -y --no-install-recommends \
libprotobuf-c1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/lib/postgresql/$PG_MAJOR/lib/decoderbufs.so /usr/lib/postgresql/$PG_MAJOR/lib/
COPY --from=build /usr/share/postgresql/$PG_MAJOR/extension/decoderbufs.control /usr/share/postgresql/$PG_MAJOR/extension/
# Copy the custom configuration which will be passed down to the server (using a .sample file is the preferred way of doing it by
# the base Docker image)
COPY postgresql.conf.sample /usr/share/postgresql/postgresql.conf.sample
# Copy the script which will initialize the replication permissions
COPY /docker-entrypoint-initdb.d/init-permissions.sh /docker-entrypoint-initdb.d/init-permissions.sh
RUN chmod +x /docker-entrypoint-initdb.d/init-permissions.sh