PostgreSQL with pgTAP. Ready for SQL unit testing and CI.
10K+
Ready-to-use PostgreSQL containers with pgTAP testing framework pre-installed. Supports PostgreSQL 18 & 17 with multi-platform builds.
# Pull and run PostgreSQL 18 with pgTAP
docker run -d --name postgres-pgtap \
-e POSTGRES_PASSWORD=mypassword \
-p 5432:5432 \
pshaddel/postgres-pgtap:latest
# Verify pgTAP is working
docker exec -it postgres-pgtap psql -U postgres -c "SELECT pgtap_version();"
latest, 18, 18.0 - Standard Debian-basedbookworm, 18-bookworm - Debian Bookwormtrixie, 18-trixie - Debian Trixie17, 17.6 - Standard Debian-based17-bookworm - Debian Bookworm17-trixie - Debian TrixiepgTAP brings unit testing to PostgreSQL with TAP (Test Anything Protocol). Write database tests directly in SQL:
SELECT plan(3);
SELECT ok(true, 'This test passes');
SELECT is(2+2, 4, 'Math works');
SELECT has_table('users', 'Table exists');
SELECT * FROM finish();
docker run -d --name my-test-db \
-e POSTGRES_DB=testdb \
-e POSTGRES_USER=tester \
-e POSTGRES_PASSWORD=secret \
-p 5432:5432 \
pshaddel/postgres-pgtap:latest
version: '3.8'
services:
postgres:
image: pshaddel/postgres-pgtap:latest
environment:
POSTGRES_DB: myapp
POSTGRES_USER: developer
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./tests:/tests
volumes:
postgres_data:
# Run your test files
docker exec -it my-test-db psql -U tester -d testdb -f /tests/my_tests.sql
# Interactive testing
docker exec -it my-test-db psql -U tester -d testdb
All images support multiple architectures:
This repository automatically:
Choose the right image for your needs:
latest, 18): Debian-based, full featuresLicense: MIT | Maintainer: pshaddelโ | pgTAP Version: 1.3
Content type
Image
Digest
sha256:5626d4fbdโฆ
Size
144.1 MB
Last updated
4 months ago
docker pull pshaddel/postgres-pgtap