-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
25 lines (21 loc) · 1 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
################################################################################
# build
################################################################################
FROM golang:1.17.8 AS build
COPY . /go/src/github.com/gocardless/stolon-pgbouncer
WORKDIR /go/src/github.com/gocardless/stolon-pgbouncer
# If we're running goreleaser, then our binary will already be copied into our
# work directory. Otherwise we should generate it with make.
RUN set -x \
&& \
if [ ! -f stolon-pgbouncer ]; then \
make bin/stolon-pgbouncer; \
mv -v bin/stolon-pgbouncer stolon-pgbouncer; \
fi
################################################################################
# release
################################################################################
FROM gocardless/stolon-pgbouncer-base:2022042601 AS release
COPY --from=build /go/src/github.com/gocardless/stolon-pgbouncer/stolon-pgbouncer /usr/local/bin/stolon-pgbouncer
USER postgres
ENTRYPOINT ["/usr/local/bin/stolon-pgbouncer"]