Skip to content

Commit 4516169

Browse files
authored
Merge pull request #5 from trycompa/miped/com-11971-upgrade-postgres-from-13-to-14
Add more postgres images
2 parents 1ec88be + 1fcec62 commit 4516169

File tree

6 files changed

+61
-6
lines changed

6 files changed

+61
-6
lines changed

.github/workflows/_docker.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: ~ build
33
on:
44
workflow_call:
55
inputs:
6+
version:
7+
type: string
8+
required: true
69
tag:
710
type: string
811
required: true
@@ -28,23 +31,23 @@ jobs:
2831
- name: 'Build Postgres Image for linux/amd64'
2932
run: |
3033
docker build \
31-
-f Dockerfile.postgres \
34+
-f Dockerfile${{ inputs.version }}.postgres \
3235
--platform linux/amd64 \
3336
-t ghcr.io/trycompa/postgres:${{ inputs.tag }}-linux-amd64 \
3437
--push .
3538
3639
- name: 'Build Postgres Image for linux/arm64'
3740
run: |
3841
docker buildx build \
39-
-f Dockerfile.postgres \
42+
-f Dockerfile${{ inputs.version }}.postgres \
4043
--platform linux/arm64 \
4144
-t ghcr.io/trycompa/postgres:${{ inputs.tag }}-linux-arm64 \
4245
--push .
4346
4447
- name: 'Build Postgres Multi-Architecture Image'
4548
run: |
4649
docker buildx build \
47-
-f Dockerfile.postgres \
50+
-f Dockerfile${{ inputs.version }}.postgres \
4851
--platform linux/amd64,linux/arm64 \
4952
-t ghcr.io/trycompa/postgres:${{ inputs.tag }} \
5053
--push .

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
jobs:
99
docker:
1010
name: docker
11+
strategy:
12+
matrix:
13+
version: [14, 15, 16]
1114
uses: ./.github/workflows/_docker.yml
1215
with:
13-
tag: '14'
16+
version: "${{ matrix.version }}"
17+
tag: "${{ matrix.version }}"

.github/workflows/pull_request.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
jobs:
88
docker:
99
name: docker
10+
strategy:
11+
matrix:
12+
version: [14, 15, 16]
1013
uses: ./.github/workflows/_docker.yml
1114
with:
12-
tag: 14-${{ github.sha }}
15+
version: "${{ matrix.version }}"
16+
tag: "${{ matrix.version }}-${{ github.sha }}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y \
88
build-essential \
99
git \
1010
postgresql-server-dev-14 \
11-
&& git clone --branch v0.5.1 https://github.com/pgvector/pgvector.git \
11+
&& git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git \
1212
&& cd pgvector \
1313
&& make \
1414
&& make install \

Dockerfile15.postgres

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Same major version as production
2+
FROM imresamu/postgis:15-3.4
3+
LABEL org.opencontainers.image.source="https://github.com/trycompa/docker-postgres"
4+
5+
6+
# Install build dependencies and pgvector
7+
RUN apt-get update && apt-get install -y \
8+
build-essential \
9+
git \
10+
postgresql-server-dev-15 \
11+
&& git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git \
12+
&& cd pgvector \
13+
&& make \
14+
&& make install \
15+
&& cd .. \
16+
&& rm -rf pgvector \
17+
&& apt-get remove -y build-essential git postgresql-server-dev-15 \
18+
&& apt-get autoremove -y \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# log all queries
22+
CMD ["postgres", "-c", "log_statement=all"]

Dockerfile16.postgres

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Same major version as production
2+
FROM imresamu/postgis:16-3.4
3+
LABEL org.opencontainers.image.source="https://github.com/trycompa/docker-postgres"
4+
5+
6+
# Install build dependencies and pgvector
7+
RUN apt-get update && apt-get install -y \
8+
build-essential \
9+
git \
10+
postgresql-server-dev-16 \
11+
&& git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git \
12+
&& cd pgvector \
13+
&& make \
14+
&& make install \
15+
&& cd .. \
16+
&& rm -rf pgvector \
17+
&& apt-get remove -y build-essential git postgresql-server-dev-16 \
18+
&& apt-get autoremove -y \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# log all queries
22+
CMD ["postgres", "-c", "log_statement=all"]

0 commit comments

Comments
 (0)