liveBook · Manning

Container image

As explained in Just Use Postgres!

A container image is an immutable package containing a filesystem and configuration from which an isolated container runtime is created.

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

How Just Use Postgres! covers it

How deep it goes
Demonstrates image selection, container startup, volumes, ports, and extension checks, while deferring production security and deployment practices.
Examples
Uses pgvector and TimescaleDB images, Docker run commands, psql connections, and extension-version queries.
What it assumes
Assumes Docker and psql usage, while showing how to find and stop conflicting PostgreSQL containers.
What you can do after
Operate/configure PostgreSQL containers by selecting an extension image, mapping port 5432, mounting a volume, and verifying availability.
How it connects
Connects container images to Docker, PostgreSQL, database extensions, port mapping, and Docker-managed volumes.

Also explained in

Compare how 25 books explain container image →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Just Use Postgres!. The section links point to the parts of the book it draws on.