A container image supplies the packaged PostgreSQL distribution and extension used to create a running container. Docker selects the image in docker run, while port mappings expose PostgreSQL and Docker-managed volumes preserve its data. section 8.2 section 9.2
Start PostgreSQL with pgvector
Create a volume, then run pgvector/pgvector:0.8.0-pg17 as the image. The resulting postgres-pgvector container listens on host port 5432 and stores database files in postgres-pgvector-volume. Connect with psql, inspect the vector extension, and enable it with CREATE EXTENSION vector;. section 8.2
Listing 8.1 Starting Postgres with pgvector on Unix
docker volume create postgres-pgvector-volume
docker run --name postgres-pgvector \
-e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password \
-p 5432:5432 \
-v postgres-pgvector-volume:/var/lib/postgresql/data \
-d pgvector/pgvector:0.8.0-pg17
Use the complete Unix command to create a volume and start PostgreSQL from the pgvector image. section 8.2
Swap the packaged extension
Run timescale/timescaledb:2.19.2-pg17 instead when the application needs TimescaleDB. The same pattern creates a named container, maps port 5432, mounts a Docker-managed volume, and verifies the installed extension through psql. section 9.2
























