-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
27 lines (22 loc) · 999 Bytes
/
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
FROM alpine:3.7
ARG pgbversion
ENV PGBOUNCER_INI_PATH /vol/pgbouncer.ini
RUN apk --update add autoconf autoconf-doc automake c-ares c-ares-dev curl gcc libc-dev libevent libevent-dev libtool make man libressl-dev pkgconfig
RUN \
# Download
curl -o /tmp/pgbouncer-$pgbversion.tar.gz -L https://pgbouncer.github.io/downloads/files/$pgbversion/pgbouncer-$pgbversion.tar.gz && \
cd /tmp && \
# Unpack, compile
tar xvfz /tmp/pgbouncer-$pgbversion.tar.gz && \
cd pgbouncer-$pgbversion && \
./configure --prefix=/usr --without-openssl && \
make && \
# Manual install
cp pgbouncer /usr/bin && \
mkdir -p /etc/pgbouncer /var/log/pgbouncer /var/run/pgbouncer && \
chown -R postgres /var/run/pgbouncer /etc/pgbouncer && \
# Cleanup
cd /tmp && \
rm -rf /tmp/pgbouncer* && \
apk del --purge autoconf autoconf-doc automake c-ares-dev curl gcc libc-dev libevent-dev libtool make man libressl-dev pkgconfig
CMD ["sh", "-c", "/usr/bin/pgbouncer $PGBOUNCER_INI_PATH -u nobody"]