{"id":31359887,"url":"https://github.com/pshaddel/postgres-pgtap-docker","last_synced_at":"2026-06-19T08:32:35.611Z","repository":{"id":284833106,"uuid":"910127590","full_name":"pshaddel/postgres-pgtap-docker","owner":"pshaddel","description":"A Docker image for PostgreSQL 17 with the pgTAP extension pre-installed for database unit testing.","archived":false,"fork":false,"pushed_at":"2026-06-11T06:38:34.000Z","size":38,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-11T08:14:23.268Z","etag":null,"topics":["database-testing","docker","pgtap","postgresql","unit-testing"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/repository/docker/pshaddel/postgres-pgtap/general","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pshaddel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-30T15:04:01.000Z","updated_at":"2026-06-11T06:38:38.000Z","dependencies_parsed_at":"2025-12-09T21:01:42.126Z","dependency_job_id":null,"html_url":"https://github.com/pshaddel/postgres-pgtap-docker","commit_stats":null,"previous_names":["pshaddel/postgres-pgtap-docker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pshaddel/postgres-pgtap-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshaddel%2Fpostgres-pgtap-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshaddel%2Fpostgres-pgtap-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshaddel%2Fpostgres-pgtap-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshaddel%2Fpostgres-pgtap-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pshaddel","download_url":"https://codeload.github.com/pshaddel/postgres-pgtap-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pshaddel%2Fpostgres-pgtap-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34523982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-testing","docker","pgtap","postgresql","unit-testing"],"created_at":"2025-09-27T00:58:41.750Z","updated_at":"2026-06-19T08:32:35.606Z","avatar_url":"https://github.com/pshaddel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL with pgTAP Docker Images\n\nThis repository provides multi-version Docker images for PostgreSQL with the pgTAP extension pre-installed. pgTAP is a unit testing framework for PostgreSQL that allows you to write tests for your database in a familiar TAP (Test Anything Protocol) format.\n\n## Features\n\n- **Multi-version support**: PostgreSQL 19 (beta), 18, and 17 images available\n- **Multi-platform**: Supports linux/arm/v7, linux/arm64/v8, and linux/amd64\n- **Multiple variants**: Standard (Debian), Bookworm, and Trixie images\n- **pgTAP pre-installed**: Ready-to-use testing framework\n- **Auto-configured**: pgTAP extension enabled automatically on startup\n- **Production-ready**: Based on official PostgreSQL images\n\n## What is pgTAP?\n\npgTAP is a unit testing framework for PostgreSQL that provides a set of functions for writing tests in SQL. It supports functions like `ok()`, `is()`, and `isnt()` to test database objects, queries, and logic.\n\n\u003e TAP, the Test Anything Protocol, is a simple text-based interface between testing modules in a test harness. It decouples the reporting of errors from the presentation of the reports.\n\n## Available Tags\n\n### PostgreSQL 19 (Beta)\n\n\u003e Beta images — not recommended for production use.\n\n- `pshaddel/postgres-pgtap:19beta1`\n- `pshaddel/postgres-pgtap:19beta1-bookworm`\n- `pshaddel/postgres-pgtap:19beta1-trixie`\n\n### PostgreSQL 18 (Latest Stable)\n\n- `pshaddel/postgres-pgtap:latest` (same as 18.4)\n- `pshaddel/postgres-pgtap:18` or `pshaddel/postgres-pgtap:18.4`\n- `pshaddel/postgres-pgtap:18.4-bookworm` or `pshaddel/postgres-pgtap:bookworm`\n- `pshaddel/postgres-pgtap:18.4-trixie` or `pshaddel/postgres-pgtap:trixie`\n\n### PostgreSQL 17\n\n- `pshaddel/postgres-pgtap:17` or `pshaddel/postgres-pgtap:17.10`\n- `pshaddel/postgres-pgtap:17.10-bookworm`\n- `pshaddel/postgres-pgtap:17.10-trixie`\n\n## How to Use\n\n### Pull the Pre-Built Image\n\nYou can pull any of the available images from Docker Hub:\n\n```sh\n# Latest PostgreSQL 18 (recommended)\ndocker pull pshaddel/postgres-pgtap:latest\n\n# Specific versions\ndocker pull pshaddel/postgres-pgtap:18\ndocker pull pshaddel/postgres-pgtap:17\n\n# Debian variants\ndocker pull pshaddel/postgres-pgtap:bookworm\ndocker pull pshaddel/postgres-pgtap:17.6-bookworm\n```\n\n### Run the Container\n\nRun the container with the following command:\n\n```sh\ndocker run -d --name my_postgres_pgtap \\\n       -e POSTGRES_USER=myuser \\\n       -e POSTGRES_PASSWORD=mypassword \\\n       -e POSTGRES_DB=mydb \\\n       -p 5432:5432 \\\n       pshaddel/postgres-pgtap:latest\n```\n\n### Access the Database\n\nYou can access the database in two ways:\n\n1. **Using a shell inside the container:**\n\n   ```sh\n   docker exec -it my_postgres_pgtap sh\n   ```\n\n   Then, use `psql` to connect to the database:\n\n   ```sh\n   psql -U myuser -d mydb\n   ```\n\n2. **Using a PostgreSQL client:**\n\n   Connect to the database using the environment variables and the exposed port:\n\n   ```sh\n   psql -h localhost -p 5432 -U myuser -d mydb\n   ```\n\n### Verify pgTAP Installation\n\nOnce connected to the database, you can verify that the `pgTAP` extension is installed and get its version:\n\n```sql\n-- Check if pgTAP extension is available\nSELECT * FROM pg_available_extensions WHERE name = 'pgtap';\n\n-- Get pgTAP version (it's pre-enabled in these images)\nSELECT pgtap_version();\n```\n\nYou should see `pgTAP` listed as an available extension and the version should return `1.3`.\n\n### Writing Tests with pgTAP\n\nTo write tests, you can use pgTAP functions like `ok()`, `is()`, and `isnt()`. For example:\n\n```sql\nSELECT plan(2);\n\nSELECT ok(1 = 1, '1 equals 1');\nSELECT is(2 + 2, 4, '2 plus 2 equals 4');\n\nSELECT * FROM finish();\n```\n\n## Building Images Locally\n\nIf you want to build the images locally, clone this repository and run the build script:\n\n```sh\n# Make the script executable\nchmod +x build-all-versions.sh\n\n# Build all versions and push to Docker Hub (requires login)\n./build-all-versions.sh\n```\n\nOr build specific versions manually:\n\n```sh\n# Build PostgreSQL 18 locally (for testing)\ndocker build -t local-postgres-pgtap-18 -f test-dockerfile-18 .\n\n# Build PostgreSQL 17 locally\ndocker build -t local-postgres-pgtap-17 -f dockerfile .\n```\n\n## How It Works\n\nThe build process performs different steps depending on the PostgreSQL version:\n\n### PostgreSQL 19 / 18 Build Process\n\n1. Starts with the official PostgreSQL image\n2. Installs `postgresql-17-pgtap` package (native PG18/19 package not yet available)\n3. Copies pgTAP extension files from the PostgreSQL 17 directories into the target version's directories\n4. Enables the `pgTAP` extension automatically on container startup\n\n### PostgreSQL 17 Build Process\n\n1. Starts with the official PostgreSQL 17 image\n2. Installs `postgresql-17-pgtap` package directly\n3. Enables the `pgTAP` extension automatically on container startup\n\n### Multi-Platform Support\n\nAll images are built for multiple architectures:\n\n- `linux/amd64` (Intel/AMD 64-bit)\n- `linux/arm64/v8` (ARM 64-bit, Apple Silicon, etc.)\n- `linux/arm/v7` (ARM 32-bit)\n\n## Automatic Updates\n\nThis repository includes automated workflows that:\n\n- **Monthly checks**: Automatically check for new PostgreSQL versions on the 1st of each month at 2 AM UTC\n- **Auto-building**: Automatically build and push new images when updates are detected\n- **Pull requests**: Create pull requests with version updates for review\n- **Multi-version support**: Handle both PostgreSQL 18 and 17 updates independently\n\nThe automation ensures that the latest PostgreSQL versions with pgTAP are always available.\n\n## Troubleshooting\n\nIf you encounter any issues:\n\n- Ensure that the required ports (default: `5432`) are not blocked by your firewall.\n- Verify that the environment variables (`POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`) are correctly set.\n- Check the container logs for errors:\n\n  ```sh\n  docker logs my_postgres_pgtap\n  ```\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Acknowledgments\n\n- [pgTAP GitHub Repository](https://github.com/theory/pgtap)\n- [PostgreSQL Official Docker Image](https://hub.docker.com/_/postgres)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpshaddel%2Fpostgres-pgtap-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpshaddel%2Fpostgres-pgtap-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpshaddel%2Fpostgres-pgtap-docker/lists"}