From ad48d92486b9d6a962c2bb53d55d8bf36a7a9208 Mon Sep 17 00:00:00 2001 From: Brent Graveland Date: Mon, 16 Dec 2024 12:31:55 -0700 Subject: [PATCH] Strip vecto.rs's .so file This brings the vectors.so file from 450mb to 12mb. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 82a67b57..8e154721 100644 --- a/Dockerfile +++ b/Dockerfile @@ -221,6 +221,7 @@ RUN set -eux; \ done; \ done +# the strip command is due to the vectors.so size: 450mb before stripping, 12mb after ARG PGVECTO_RS RUN set -ex; \ if [ -n "${PGVECTO_RS}" ]; then \ @@ -232,7 +233,8 @@ RUN set -ex; \ --output /tmp/vectors.deb \ "https://github.com/tensorchord/pgvecto.rs/releases/download/v${PGVECTO_RS}/vectors-pg${pg}_${PGVECTO_RS}_$(dpkg --print-architecture).deb" && \ dpkg -i /tmp/vectors.deb && \ - rm -rfv /tmp/vectors.deb; \ + rm -rfv /tmp/vectors.deb && \ + strip --strip-unneeded "/usr/lib/postgresql/${pg}/lib/vectors.so"; \ fi \ done; \ fi