pgvector / pgvector

Open-source vector similarity search for Postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Docs] Add Docker COPY from Example

yordis opened this issue · comments

Hey there, I am aware of #484, but I am asking something differently,

We could "merge" the pgvector image into the base image.

  • Why would you do that?

I have other extension requirements aside from pgvector, and I am hoping that such a pattern becomes familiar enough so Extension Authors could provide a straightforward image to COPY from instead of relying on tools like pgxn or pgxman, or deal with "complex" (unfamiliar) installations steps and instead take advantage of Official Docker Image.

FROM postgres:latest

COPY --from=pgvector/pgvector:pg16 /[help here] /[help here]

I appreciate any help you can provide.

Hi @yordis, feel free to share if you get this working. You can see which files pgvector installs by looking at the output of make install.

If this is targeted for a production build, I'd recommend just installing pgvector from a package into the container image. I checked the upstream PostgreSQL repos, and both yum and apt include pgvector.

@jkatz I ended up just using apt, but I wish it happened across the ecosystem to be able to pull from another Docker Image into the base one. Not everyone is publishing, but I found they mainly provide Docker images.

Imagine the following as a standard:

FROM postgres:16-bookworm

COPY --from=pgvector/pgvector:0.6.2-extension /PGEXTENSION/${PG_MAJOR} /

That tree under /PGEXTENSION has ONLY the files required to copy into my image, making it safe to copy everything from it into the / safely.