diff --git a/pooler/Dockerfile b/pooler/Dockerfile index 31e81d568..dd924b558 100644 --- a/pooler/Dockerfile +++ b/pooler/Dockerfile @@ -1,52 +1,48 @@ ARG BASE_IMAGE=alpine:3.19 -FROM $BASE_IMAGE AS build_stage +FROM ${BASE_IMAGE} AS build_stage -WORKDIR / RUN apk --update add \ autoconf automake build-base c-ares-dev git libevent-dev libtool m4 \ openssl-dev py3-docutils py3-pip python3 +WORKDIR /src + RUN git clone \ --single-branch \ --branch=stable-1.23 \ --depth 1 \ - https://github.com/pgbouncer/pgbouncer.git + https://github.com/pgbouncer/pgbouncer.git . -WORKDIR /bin -RUN ln -s ../usr/bin/rst2man.py rst2man - -WORKDIR /src -RUN git submodule init -RUN git submodule update +RUN git submodule init && git submodule update +RUN ln -s /usr/bin/rst2man.py /usr/bin/rst2man RUN ./autogen.sh -RUN ./configure --prefix=/pgbouncer --with-libevent=/usr/lib +RUN ./configure --prefix=/pgbouncer --with-libevent=/usr/lib RUN sed -i '/dist_man_MANS/d' Makefile RUN make RUN make install -WORKDIR /src/test -RUN make check +FROM ${BASE_IMAGE} -FROM $BASE_IMAGE RUN apk -U upgrade --no-cache \ && apk --no-cache add bash c-ares ca-certificates gettext libevent openssl postgresql-client -RUN \ - addgroup -g 101 -S pgbouncer && \ - adduser -u 100 -S pgbouncer && \ +RUN addgroup -g 101 -S pgbouncer && \ + adduser -u 100 -S pgbouncer -G pgbouncer && \ mkdir -p /etc/pgbouncer /var/log/pgbouncer /var/run/pgbouncer /etc/ssl/certs COPY --from=build_stage /pgbouncer/bin/pgbouncer /bin/pgbouncer COPY pgbouncer.ini.tmpl auth_file.txt.tmpl /etc/pgbouncer/ -COPY entrypoint.sh ./ +COPY entrypoint.sh /entrypoint.sh RUN chown -R pgbouncer:pgbouncer \ - /var/log/pgbouncer \ - /var/run/pgbouncer \ - /etc/pgbouncer \ - /etc/ssl/certs \ - && chmod 0755 /entrypoint.sh + /var/log/pgbouncer \ + /var/run/pgbouncer \ + /etc/pgbouncer \ + /etc/ssl/certs \ + && chmod +x /entrypoint.sh USER pgbouncer:pgbouncer -ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] +WORKDIR /etc/pgbouncer + +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] \ No newline at end of file