File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ ARG PG_VECTOR_VERSION=0.8.0
44FROM imresamu/postgis:$PG_MAJOR-3.5-bookworm
55ARG PG_MAJOR
66ARG PG_VECTOR_VERSION
7+ ARG TARGETARCH
78
89LABEL org.opencontainers.image.title="postgis-vector" \
910 org.opencontainers.image.description="postgresql+postgis container with pgvector added" \
@@ -25,8 +26,15 @@ RUN apt-get update \
2526 pgxnclient \
2627 postgresql-server-dev-$PG_MAJOR \
2728 && git clone --branch v"${PG_VECTOR_VERSION}" https://github.com/pgvector/pgvector.git /tmp/pgvector \
29+ # Portable fast flags for ARM (the default flags crash on Apple m1 macbooks if image built in GitHub CI); native for AMD64
2830 && cd /tmp/pgvector \
29- && make && make install \
31+ && if [ "$TARGETARCH" = "arm64" ]; then \
32+ echo "Building pgvector for ARM64 (portable)" ; \
33+ make OPTFLAGS="-O3 -march=armv8-a -mtune=generic" && make install; \
34+ else \
35+ echo "Building pgvector for AMD64 (native)" ; \
36+ make OPTFLAGS="-O3 -march=native" && make install; \
37+ fi \
3038 && cd / \
3139 && rm -rf /tmp/pgvector \
3240 && apt-get remove -y build-essential clang-13 llvm-13 llvm-13-dev postgresql-server-dev-$PG_MAJOR \
You can’t perform that action at this time.
0 commit comments