Sign inSign up

pshaddel/postgres-pgtap

By pshaddel

โ€ขUpdated 1 day ago

PostgreSQL with pgTAP. Ready for SQL unit testing and CI.

Image
Databases & storage
1

10K+

pshaddel/postgres-pgtap repository overview

โ PostgreSQL with pgTAP - Multi-Version Docker Images

Ready-to-use PostgreSQL containers with pgTAP testing framework pre-installed. Supports PostgreSQL 18 & 17 with multi-platform builds.

โ ๐Ÿš€ Quick Start

# 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();"

โ ๐Ÿ“‹ Available Tags

โ PostgreSQL 18 (Latest)
  • latest, 18, 18.0 - Standard Debian-based
  • bookworm, 18-bookworm - Debian Bookworm
  • trixie, 18-trixie - Debian Trixie
โ PostgreSQL 17
  • 17, 17.6 - Standard Debian-based
  • 17-bookworm - Debian Bookworm
  • 17-trixie - Debian Trixie

โ โœจ Features

  • ๐Ÿงช pgTAP 1.3 - Full testing framework pre-installed
  • ๐ŸŒ Multi-platform - AMD64, ARM64, ARMv7 support
  • ๐Ÿ”ง Auto-configured - Extension enabled on startup
  • ๐Ÿณ Production-ready - Based on official PostgreSQL images
  • ๐Ÿ“ฆ Multiple variants - Debian-based options available
  • ๐Ÿ”„ Auto-updated - Latest PostgreSQL versions daily

โ ๐Ÿ“– What is pgTAP?

pgTAP 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();

โ ๐Ÿ› ๏ธ Usage Examples

โ Basic Setup
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
โ With Docker Compose
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:
โ Running Tests
# 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

โ ๐Ÿ—๏ธ Architecture Support

All images support multiple architectures:

  • linux/amd64 - Intel/AMD 64-bit
  • linux/arm64 - ARM 64-bit (Apple Silicon, AWS Graviton)
  • linux/arm/v7 - ARM 32-bit (Raspberry Pi)

โ ๐Ÿ”„ Automatic Updates

This repository automatically:

  • โœ… Checks for new PostgreSQL releases daily
  • โœ… Builds updated images with latest security patches
  • โœ… Maintains pgTAP compatibility across versions
  • โœ… Supports both PostgreSQL 18 and 17 independently

โ ๐Ÿ“š Documentation & Source

โ ๐Ÿท๏ธ Tags Explained

Choose the right image for your needs:

  • Standard tags (latest, 18): Debian-based, full features
  • Bookworm/Trixie: Specific Debian versions for compatibility

โ ๐Ÿ’ก Why Use This Image?

  • Ready to test - No setup required, pgTAP works immediately
  • CI/CD friendly - Perfect for automated database testing
  • Multi-platform - Same image works on Intel, AMD, and ARM
  • Always current - Automated updates ensure latest PostgreSQL versions
  • Flexible - Multiple base OS options for different requirements

License: MIT | Maintainer: pshaddelโ  | pgTAP Version: 1.3

Tag summary

Content type

Image

Digest

sha256:5626d4fbdโ€ฆ

Size

144.1 MB

Last updated

4 months ago

docker pull pshaddel/postgres-pgtap