pg.ddx.io pgvector/pgvector GitHub issues and pull requests
help / color / mirror / Atom feed[pgvector/pgvector] PR #193: Add Alpine Dockerfile
6+ messages / 4 participants
[nested] [flat]
* [pgvector/pgvector] PR #193: Add Alpine Dockerfile
@ 2023-07-22 15:57 "jramos (@jramos)" <noreply+jramos@github.com>
0 siblings, 0 replies; 6+ messages in thread
From: jramos (@jramos) @ 2023-07-22 15:57 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
This adds a Dockerfile for creating an Alpine build. The resulting image is ~80MB smaller than the Debian image.
inline patch 1: Dockerfile.alpine, README.md (+24/-0 lines) download inline-1.patch
diff --git a/Dockerfile.alpine b/Dockerfile.alpine
new file mode 100644
index 000000000..166232d3d
--- /dev/null
+++ b/Dockerfile.alpine
@@ -0,0 +1,16 @@
+ARG PG_MAJOR=15
+
+FROM postgres:${PG_MAJOR}-alpine
+ARG PG_MAJOR
+
+COPY . /tmp/pgvector
+
+RUN apk add --no-cache build-base clang15 llvm15 postgresql${PG_MAJOR}-dev && \
+ cd /tmp/pgvector && \
+ make clean && \
+ make OPTFLAGS="" && \
+ make install && \
+ mkdir -p /usr/share/doc/pgvector && \
+ cp LICENSE README.md /usr/share/doc/pgvector && \
+ apk del --no-cache build-base clang15 llvm15 postgresql${PG_MAJOR}-dev && \
+ rm -r /tmp/pgvector
diff --git a/README.md b/README.md
index be02c961e..d09f32e07 100644
--- a/README.md
+++ b/README.md
@@ -423,6 +423,14 @@ cd pgvector
docker build --build-arg PG_MAJOR=15 -t myuser/pgvector .
```
+The default image is based on Debian 11 (bullseye). To build an [Alpine](https://www.alpinelinux.org/) image, use `Dockerfile.alpine`:
+
+```sh
+git clone --branch v0.4.4 https://github.com/pgvector/pgvector.git
+cd pgvector
+docker build --build-arg PG_MAJOR=15 -t myuser/pgvector -f Dockerfile.alpine .
+```
+
### Homebrew
With Homebrew Postgres, you can use:
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgvector/pgvector] PR #193: Add Alpine Dockerfile
@ 2023-08-27 21:08 "ankane (@ankane)" <noreply+ankane@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: ankane (@ankane) @ 2023-08-27 21:08 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi @jramos, thanks for the PR. I'd only like to support one Dockerfile right now, but this should be a useful reference for other users who are interested in it.
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgvector/pgvector] PR #193: Add Alpine Dockerfile
@ 2023-08-27 21:08 "ankane (@ankane)" <noreply+ankane@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: ankane (@ankane) @ 2023-08-27 21:08 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane closed this.
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgvector/pgvector] PR #193: Add Alpine Dockerfile
@ 2024-07-26 15:25 "SamuelMarks (@SamuelMarks)" <noreply+SamuelMarks@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: SamuelMarks (@SamuelMarks) @ 2024-07-26 15:25 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Thanks @jramos ; until the pgvector maintainers change their mind I've setup automated and scheduled releases to Docker Hub of the alpine variant - https://hub.docker.com/r/samuelmarks/pgvector-builds
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgvector/pgvector] PR #193: Add Alpine Dockerfile
@ 2025-06-11 15:36 "0xMurage (@0xMurage)" <noreply+0xMurage@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: 0xMurage (@0xMurage) @ 2025-06-11 15:36 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Adding this for future you/AI who will encounter headaches with builds:
Use clang and llvm 19 when building for pgvector v0.7.3+ with postgres 16+ i.e.
`apk add --no-cache build-base clang19 llvm19 postgresql${PG_MAJOR}-dev `
^ permalink raw [nested|flat] 6+ messages in thread
* Re: [pgvector/pgvector] PR #193: Add Alpine Dockerfile
@ 2025-06-11 17:18 "SamuelMarks (@SamuelMarks)" <noreply+SamuelMarks@github.com>
4 siblings, 0 replies; 6+ messages in thread
From: SamuelMarks (@SamuelMarks) @ 2025-06-11 17:18 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@0xMurage good point, updated https://github.com/SamuelMarks/pgvector-builds https://hub.docker.com/r/samuelmarks/pgvector-builds
^ permalink raw [nested|flat] 6+ messages in thread
end of thread, other threads:[~2025-06-11 17:18 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-07-22 15:57 [pgvector/pgvector] PR #193: Add Alpine Dockerfile "jramos (@jramos)" <noreply+jramos@github.com>
2023-08-27 21:08 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-08-27 21:08 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-07-26 15:25 ` "SamuelMarks (@SamuelMarks)" <noreply+SamuelMarks@github.com>
2025-06-11 15:36 ` "0xMurage (@0xMurage)" <noreply+0xMurage@github.com>
2025-06-11 17:18 ` "SamuelMarks (@SamuelMarks)" <noreply+SamuelMarks@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox