Skip to content

Commit 1243d8d

Browse files
committed
add more postgres versions
1 parent 28e6d7c commit 1243d8d

File tree

6 files changed

+85
-21
lines changed

6 files changed

+85
-21
lines changed

.github/workflows/docker-publish.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616
contents: read
1717
packages: write
1818

19+
strategy:
20+
matrix:
21+
pg_version: [14, 15, 16, 17]
22+
1923
steps:
2024
- name: Checkout repository
2125
uses: actions/checkout@v4
@@ -26,11 +30,11 @@ jobs:
2630
- name: Set up Docker Buildx
2731
uses: docker/setup-buildx-action@v3
2832

29-
- name: Log into registry ${{ env.REGISTRY }}
33+
- name: Login to GitHub Container Registry
3034
if: github.event_name != 'pull_request'
3135
uses: docker/login-action@v3
3236
with:
33-
registry: ${{ env.REGISTRY }}
37+
registry: ghcr.io
3438
username: ${{ github.actor }}
3539
password: ${{ secrets.GITHUB_TOKEN }}
3640

@@ -40,20 +44,24 @@ jobs:
4044
with:
4145
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4246

43-
- name: Build and push Docker image (postgres:14)
44-
uses: docker/build-push-action@v5
45-
with:
46-
push: ${{ github.event_name != 'pull_request' }}
47-
platforms: linux/amd64,linux/arm64
48-
file: 14/Dockerfile
49-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:14
50-
labels: ${{ steps.meta.outputs.labels }}
47+
- name: Set latest tag
48+
run: |
49+
echo "Setting tags..."
50+
if [ "${{ matrix.pg_version }}" = "17" ]; then
51+
echo "LATEST_TAG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_ENV
52+
else
53+
echo "LATEST_TAG=" >> $GITHUB_ENV
54+
fi
5155
52-
- name: Build and push Docker image (postgres:16)
53-
uses: docker/build-push-action@v5
56+
- name: Build and push Docker image (postgres:${{ matrix.pg_version }})
57+
uses: docker/build-push-action@v6
5458
with:
5559
push: ${{ github.event_name != 'pull_request' }}
60+
tags: |
61+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.pg_version }}
62+
${{ env.LATEST_TAG }}
5663
platforms: linux/amd64,linux/arm64
57-
file: 16/Dockerfile
58-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:16,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
64+
file: ${{ matrix.pg_version }}/Dockerfile
65+
cache-from: type=gha
66+
cache-to: type=gha,mode=max
5967
labels: ${{ steps.meta.outputs.labels }}

14/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM postgres:14-bookworm
1+
FROM postgres:14.17-bookworm
22

33
LABEL maintainer="codestation <[email protected]>"
44

5-
ARG BACKREST_VERSION=2.53.1
6-
ARG S6_OVERLAY_VERSION=3.2.0.0
5+
ARG BACKREST_VERSION=2.54.2
6+
ARG S6_OVERLAY_VERSION=3.2.0.2
77

88
# Install pgbackrest
99
RUN set -ex; \

15/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM postgres:15.12-bookworm
2+
3+
LABEL maintainer="codestation <[email protected]>"
4+
5+
ARG BACKREST_VERSION=2.54.2
6+
ARG S6_OVERLAY_VERSION=3.2.0.2
7+
8+
# Install pgbackrest
9+
RUN set -ex; \
10+
apt-get update; \
11+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
12+
ca-certificates \
13+
curl \
14+
pgbackrest=${BACKREST_VERSION}-* \
15+
; \
16+
rm -rf /var/lib/apt/lists/*;
17+
18+
RUN set -ex; \
19+
curl -L https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz -o /tmp/s6-overlay-noarch.tar.xz ; \
20+
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz ;\
21+
rm /tmp/s6-overlay-noarch.tar.xz ;\
22+
curl -L https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-$(arch).tar.xz -o /tmp/s6-overlay-$(arch).tar.xz ; \
23+
tar -C / -Jxpf /tmp/s6-overlay-$(arch).tar.xz ;\
24+
rm /tmp/s6-overlay-$(arch).tar.xz
25+
26+
COPY services/ /etc/s6-overlay/s6-rc.d/
27+
28+
ENTRYPOINT ["/init"]

16/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM postgres:16-bookworm
1+
FROM postgres:16.8-bookworm
22

33
LABEL maintainer="codestation <[email protected]>"
44

5-
ARG BACKREST_VERSION=2.53.1
6-
ARG S6_OVERLAY_VERSION=3.2.0.0
5+
ARG BACKREST_VERSION=2.54.2
6+
ARG S6_OVERLAY_VERSION=3.2.0.2
77

88
# Install pgbackrest
99
RUN set -ex; \

17/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM postgres:17.4-bookworm
2+
3+
LABEL maintainer="codestation <[email protected]>"
4+
5+
ARG BACKREST_VERSION=2.54.2
6+
ARG S6_OVERLAY_VERSION=3.2.0.2
7+
8+
# Install pgbackrest
9+
RUN set -ex; \
10+
apt-get update; \
11+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
12+
ca-certificates \
13+
curl \
14+
pgbackrest=${BACKREST_VERSION}-* \
15+
; \
16+
rm -rf /var/lib/apt/lists/*;
17+
18+
RUN set -ex; \
19+
curl -L https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz -o /tmp/s6-overlay-noarch.tar.xz ; \
20+
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz ;\
21+
rm /tmp/s6-overlay-noarch.tar.xz ;\
22+
curl -L https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-$(arch).tar.xz -o /tmp/s6-overlay-$(arch).tar.xz ; \
23+
tar -C / -Jxpf /tmp/s6-overlay-$(arch).tar.xz ;\
24+
rm /tmp/s6-overlay-$(arch).tar.xz
25+
26+
COPY services/ /etc/s6-overlay/s6-rc.d/
27+
28+
ENTRYPOINT ["/init"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
## Postgres images
22

3-
Postgres 14/16 images with pgbackrest 2.51 installed.
3+
Postgres 14/15/16/17 images with pgbackrest 2.52 installed.

0 commit comments

Comments
 (0)