forked from budimanjojo/crunchy-postgres-vectorchord
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdate-Dockerfile
More file actions
34 lines (29 loc) · 1.21 KB
/
Update-Dockerfile
File metadata and controls
34 lines (29 loc) · 1.21 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
29
30
31
32
33
34
ARG CDPG_TAG
FROM registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:${CDPG_TAG}
ARG TARGETARCH
ARG VECTORCHORD_TAG
ARG CDPG_TAG
# drop to root to copy files
USER root
RUN PG_MAJOR=$(echo "$CDPG_TAG" | cut -d'-' -f2 | cut -d'.' -f1) && \
case "$TARGETARCH" in \
amd64) URLARCH="x86_64-linux" ;; \
arm64) URLARCH="aarch64-linux" ;; \
*) echo "Unsupported architecture: $TARGETARCH" && exit 1 ;; \
esac && \
curl -L \
"https://github.com/tensorchord/VectorChord/releases/download/${VECTORCHORD_TAG}/postgresql-${PG_MAJOR}-vchord_${VECTORCHORD_TAG}_${URLARCH}-gnu.zip" \
-o /tmp/vchord.zip && \
unzip /tmp/vchord.zip -d /tmp && \
case "$VECTORCHORD_TAG" in \
"0.3.0"|"0.4.0"|"0.4.1") \
cp /tmp/vchord.so $(pg_config --pkglibdir) && \
cp /tmp/vchord.control $(pg_config --sharedir)/extension && \
cp /tmp/vchord-*.sql $(pg_config --sharedir)/extension && \
rm -rf /tmp/vchord*;; \
*) \
cp -r /tmp/pkglibdir/. $(pg_config --pkglibdir) && \
cp -r /tmp/sharedir/. $(pg_config --sharedir) && \
rm -rf /tmp/vchord.zip /tmp/pkglibdir /tmp/sharedir ;; \
esac
USER 26