Skip to content

Commit 4b8dc5c

Browse files
authored
Bump HAProxy to 2.7 (#173)
* Bump HAProxy to 2.7 * Bump haproxy version in timescale image * Use arg
1 parent 23d4de7 commit 4b8dc5c

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

Dockerfile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG PG_VERSION=15.2
22
ARG PG_MAJOR_VERSION=15
33
ARG VERSION=custom
44

5-
FROM golang:1.20 as flyutil
5+
FROM golang:1.20
66

77
WORKDIR /go/src/github.com/fly-examples/fly-postgres
88
COPY . .
@@ -17,27 +17,39 @@ RUN CGO_ENABLED=0 GOOS=linux go build -v -o /fly/bin/start ./cmd/start
1717
COPY ./bin/* /fly/bin/
1818

1919
FROM wrouesnel/postgres_exporter:latest AS postgres_exporter
20-
2120
FROM postgres:${PG_VERSION}
2221
ENV PGDATA=/data/postgresql
2322
ARG VERSION
2423
ARG PG_MAJOR_VERSION
2524
ARG POSTGIS_MAJOR=3
26-
25+
ARG HAPROXY_VERSION=2.7
2726

2827
LABEL fly.app_role=postgres_cluster
2928
LABEL fly.version=${VERSION}
3029
LABEL fly.pg-version=${PG_VERSION}
3130
LABEL fly.pg-manager=repmgr
3231

3332
RUN apt-get update && apt-get install --no-install-recommends -y \
34-
ca-certificates iproute2 postgresql-$PG_MAJOR_VERSION-repmgr curl bash dnsutils vim haproxy socat procps ssh \
33+
ca-certificates iproute2 postgresql-$PG_MAJOR_VERSION-repmgr curl bash dnsutils vim socat procps ssh gnupg \
3534
&& apt autoremove -y
3635

36+
# PostGIS
3737
RUN apt-get update && apt-get install --no-install-recommends -y \
3838
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
3939
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts
4040

41+
# Haproxy
42+
RUN curl https://haproxy.debian.net/bernat.debian.org.gpg \
43+
| gpg --dearmor > /usr/share/keyrings/haproxy.debian.net.gpg
44+
45+
RUN echo deb "[signed-by=/usr/share/keyrings/haproxy.debian.net.gpg]" \
46+
http://haproxy.debian.net bullseye-backports-${HAPROXY_VERSION} main \
47+
> /etc/apt/sources.list.d/haproxy.list
48+
49+
RUN apt-get update && apt-get install --no-install-recommends -y \
50+
haproxy=$HAPROXY_VERSION.\* \
51+
&& apt autoremove -y
52+
4153
COPY --from=0 /fly/bin/* /usr/local/bin
4254
COPY --from=postgres_exporter /postgres_exporter /usr/local/bin/
4355

Dockerfile-timescaledb

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG PG_VERSION=15.2
22
ARG PG_MAJOR_VERSION=15
33
ARG VERSION=custom
44

5-
FROM golang:1.20 as flyutil
5+
FROM golang:1.20
66

77
WORKDIR /go/src/github.com/fly-examples/fly-postgres
88
COPY . .
@@ -23,27 +23,40 @@ ENV PGDATA=/data/postgresql
2323
ARG VERSION
2424
ARG PG_MAJOR_VERSION
2525
ARG POSTGIS_MAJOR=3
26-
26+
ARG HAPROXY_VERSION=2.7
2727

2828
LABEL fly.app_role=postgres_cluster
2929
LABEL fly.version=${VERSION}
3030
LABEL fly.pg-version=${PG_VERSION}
3131
LABEL fly.pg-manager=repmgr
3232

3333
RUN apt-get update && apt-get install --no-install-recommends -y \
34-
ca-certificates iproute2 postgresql-$PG_MAJOR_VERSION-repmgr curl bash dnsutils vim haproxy socat procps ssh \
34+
ca-certificates iproute2 postgresql-$PG_MAJOR_VERSION-repmgr curl bash dnsutils vim haproxy socat procps ssh gnupg \
3535
&& apt autoremove -y
3636

3737
RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(cat /etc/os-release | grep VERSION_CODENAME | cut -d'=' -f2) main" > /etc/apt/sources.list.d/timescaledb.list \
3838
&& curl -L https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add -
3939

40+
# TimescaleDB and PostGIS
4041
RUN apt-get update && apt-get install --no-install-recommends -y \
4142
postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR \
4243
postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR-scripts \
4344
timescaledb-2-postgresql-$PG_MAJOR_VERSION \
4445
timescaledb-toolkit-postgresql-$PG_MAJOR_VERSION \
4546
&& apt autoremove -y
4647

48+
# Haproxy
49+
RUN curl https://haproxy.debian.net/bernat.debian.org.gpg \
50+
| gpg --dearmor > /usr/share/keyrings/haproxy.debian.net.gpg
51+
52+
RUN echo deb "[signed-by=/usr/share/keyrings/haproxy.debian.net.gpg]" \
53+
http://haproxy.debian.net bullseye-backports-${HAPROXY_VERSION} main \
54+
> /etc/apt/sources.list.d/haproxy.list
55+
56+
RUN apt-get update && apt-get install --no-install-recommends -y \
57+
haproxy=$HAPROXY_VERSION.\* \
58+
&& apt autoremove -y
59+
4760
COPY --from=0 /fly/bin/* /usr/local/bin
4861
COPY --from=postgres_exporter /postgres_exporter /usr/local/bin/
4962

0 commit comments

Comments
 (0)