Skip to content

Commit

Permalink
Add support for postgresql v12-15
Browse files Browse the repository at this point in the history
Upgrade to alpine 3.18, supporting newer postgresql versions.
Since we set the default postgresql version to 12, this should be a
non-breaking change.
  • Loading branch information
Jasper-Ben committed Nov 19, 2024
1 parent 179d98a commit 056ebd3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
27 changes: 23 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
FROM alpine:3.11
FROM alpine:3.18
ARG DEFAULT_PG_VERSION=12
ARG INFLUXDB_VERSION=1.11.7
ARG INFLUXDB_SHA256="00c85ff0abbfbc165663ac5feae7e4e36b6d13c9c003e7a400edd013b356da08"

RUN apk add --no-cache ca-certificates
RUN apk add --no-cache --virtual .build-deps curl && curl https://dl.min.io/client/mc/release/linux-amd64/mc > /usr/bin/mc && chmod +x /usr/bin/mc && apk del .build-deps
RUN apk add --no-cache postgresql-client mysql-client bash tar influxdb curl jq
RUN apk add --no-cache \
postgresql12-client \
postgresql13-client \
postgresql14-client \
postgresql15-client
RUN pg_versions set-default ${DEFAULT_PG_VERSION}
RUN apk add --no-cache mysql-client bash tar curl jq
WORKDIR /tmp
RUN curl -SsfL https://download.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}-linux-amd64.tar.gz -o influxdb.tar.gz \
&& test "$(sha256sum influxdb.tar.gz | awk 'NR==1{print $1}')" = "${INFLUXDB_SHA256}" \
&& tar -xf influxdb.tar.gz \
&& mkdir -p /etc/influxdb \
&& mv influxdb.conf /etc/influxdb \
&& mv influx* /usr/local/bin \
&& rm -f influxdb.tar.gz
ENV INFLUXDB_CONFIG_PATH="/etc/influxdb/influxdb.conf"
WORKDIR /
ADD s3_to_s3.sh /usr/bin/s3_to_s3.sh
RUN chmod +x /usr/bin/s3_to_s3.sh

ENTRYPOINT ["/bin/bash"]
ADD entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ This is the `minio/mc` image with some additional database clients, which we nee
- `LOCAL_SECRET_KEY` - Local S3 secret key
- vice versa for `REMOTE`
- `REMOTE_PREFIX` - Prefix for the remote backups bucket names.
- This will e.g. copy from `local/bucket` to `remote/prefix-bucket-s3-backup`
- This will e.g. copy from `local/bucket` to `remote/prefix-bucket-s3-backup`

## Postgresql backup

For running postgresql backup, the used postgresql client version must match the server version. This image currently contains postgresql clients 12-15 (default=12).

To change the postgresql client version, set the environment variable `DEFAULT_PG_VERSION` accordingly when running this image.
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

if test -n "${DEFAULT_PG_VERSION}"; then
pg_versions set-default "${DEFAULT_PG_VERSION}"
fi

if [ -z "$1" ]; then
exec /bin/bash
else
exec "$@"
fi

0 comments on commit 056ebd3

Please sign in to comment.