-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.alpine
More file actions
29 lines (26 loc) · 1.22 KB
/
Dockerfile.alpine
File metadata and controls
29 lines (26 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
ARG BASE=postgres
ARG BASE_VERSION=13.3-alpine
FROM ${BASE}:${BASE_VERSION}
LABEL org.opencontainers.image.source="https://github.com/launchql/launchql"
ARG BASE
ARG BASE_VERSION
ARG PGVECTOR_REF="v0.8.1"
ENV BASE_VERSION=${BASE_VERSION}
ENV PGVECTOR_REF=${PGVECTOR_REF}
# Alpine build (kept as a backup variant)
RUN set -eux; \
: "${BASE_VERSION:?BASE_VERSION not set}"; \
apk add --no-cache --virtual .build-deps git build-base bash make curl ca-certificates; \
LLVM_CFG=$(pg_config --configure | tr ' ' '\n' | sed -n 's/^LLVM_CONFIG=\(.*\)$/\1/p' | tr -d '\"\'\'' ); \
[ -n "${LLVM_CFG}" ] || { echo "Server not built with LLVM (LLVM_CONFIG missing)" >&2; exit 1; }; \
LLVM_VER=$(echo "${LLVM_CFG}" | sed -E 's#.*/llvm-?([0-9]+)/.*#\1#'); \
[ -n "${LLVM_VER}" ] || { echo "Could not determine LLVM version from: ${LLVM_CFG}" >&2; exit 1; }; \
apk add --no-cache --virtual .clang \
"clang${LLVM_VER}" \
"llvm${LLVM_VER}" \
"llvm${LLVM_VER}-libs" \
"llvm${LLVM_VER}-linker-tools"; \
git clone --quiet --depth 1 --branch "${PGVECTOR_REF}" https://github.com/pgvector/pgvector.git; \
cd pgvector && make && make install; \
cd .. && rm -rf pgvector; \
apk del .clang .build-deps