forked from awslabs/pgbouncer-fast-switchover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.local
33 lines (28 loc) · 1.29 KB
/
Dockerfile.local
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
FROM public.ecr.aws/amazonlinux/amazonlinux:2023
RUN yum -y update
RUN yum install -y tar net-tools curl vim unzip less libevent-devel openssl-devel python-devel libtool git patch make gcc wget --allowerasing
# Install pandoc
RUN ARCH="" && if [ "$(uname -m)" = "x86_64" ]; then ARCH='amd64'; else ARCH='arm64'; fi && export ${ARCH} && \
wget https://github.com/jgm/pandoc/releases/download/3.1.6.2/pandoc-3.1.6.2-linux-${ARCH}.tar.gz && \
tar xvzf ./pandoc-3.1.6.2-linux-${ARCH}.tar.gz --strip-components 1 -C /usr/local
RUN git clone https://github.com/pgbouncer/pgbouncer.git --branch "stable-1.19" && \
git clone https://github.com/awslabs/pgbouncer-rr-patch.git && \
cd pgbouncer-rr-patch && \
./install-pgbouncer-rr-patch.sh ../pgbouncer && \
cd ../pgbouncer && \
git submodule init && \
git submodule update && \
./autogen.sh && \
./configure --prefix=/usr/local --exec-prefix=/usr/bin --bindir=/usr/bin && \
make && \
make install
# Installed with pgbouncer
RUN useradd -ms /bin/bash pgbouncer && \
chown pgbouncer /home/pgbouncer && \
chown pgbouncer /
USER pgbouncer
WORKDIR /home/pgbouncer
COPY ./start.sh /start.sh
COPY ./pub_metrics.sh /pub_metrics.sh
COPY ./adaptivepgbouncer.sh /adaptivepgbouncer.sh
COPY ./routing_rules.py /home/pgbouncer/