Skip to content

Commit f12344a

Browse files
committed
feat: support both arm64 and amd64
1 parent 2fed74b commit f12344a

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ jobs:
3434
username: ${{ github.actor }}
3535
password: ${{ secrets.GITHUB_TOKEN }}
3636

37-
- name: Build and push Docker image
37+
- name: Build and Push Multi-Arch Image
3838
uses: docker/build-push-action@v5
3939
with:
4040
context: .
4141
file: ./Dockerfile
4242
push: true
43+
platforms: linux/amd64,linux/arm64
4344
tags: |
4445
ghcr.io/${{ github.repository }}:${{ steps.docker_meta.outputs.VERSION }}
4546
ghcr.io/${{ github.repository }}:latest

Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
ARG PG_MAJOR=17
2-
FROM postgis/postgis:$PG_MAJOR-3.5
2+
ARG PG_VECTOR_VERSION=0.8.0
3+
# See https://github.com/postgis/docker-postgis/issues/216
4+
FROM imresamu/postgis:$PG_MAJOR-3.5-bookworm
35
ARG PG_MAJOR
6+
ARG PG_VECTOR_VERSION
47

58
LABEL org.opencontainers.image.title="postgis-vector" \
69
org.opencontainers.image.description="postgresql+postgis container with pgvector added" \
710
org.opencontainers.image.vendor="Payload" \
811
org.opencontainers.image.authors="Payload <[email protected]>" \
9-
org.opencontainers.image.version="17-3.5" \
12+
org.opencontainers.image.version="17-4.0" \
1013
org.opencontainers.image.licenses="MIT" \
1114
org.opencontainers.image.url="https://github.com/payloadcms/postgis-vector" \
1215
org.opencontainers.image.source="https://github.com/payloadcms/postgis-vector"
@@ -15,12 +18,17 @@ RUN apt-get update \
1518
&& apt-mark hold locales \
1619
&& apt-get install -qq -y --no-install-recommends \
1720
build-essential \
21+
git \
1822
clang-13 \
1923
llvm-13 \
2024
llvm-13-dev \
2125
pgxnclient \
2226
postgresql-server-dev-$PG_MAJOR \
23-
&& pgxn install 'vector=0.8.0' \
27+
&& git clone --branch v"${PG_VECTOR_VERSION}" https://github.com/pgvector/pgvector.git /tmp/pgvector \
28+
&& cd /tmp/pgvector \
29+
&& make && make install \
30+
&& cd / \
31+
&& rm -rf /tmp/pgvector \
2432
&& apt-get remove -y build-essential clang-13 llvm-13 llvm-13-dev postgresql-server-dev-$PG_MAJOR \
2533
&& apt-get autoremove -y \
2634
&& apt-get clean \

docker-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
docker build --platform=linux/amd64 -t pgtest .
3+
docker build -t pgtest .

0 commit comments

Comments
 (0)