docker-pg

Automate PostgreSQL extension testing with pg_regress inside Docker containers.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/preedep/kham --skill docker-pg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-pg
Source: https://github.com/preedep/kham/tree/main/.claude/skills/docker-pg
Command: npx skills add https://github.com/preedep/kham --skill docker-pg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running PostgreSQL extensions inside Docker containers for integration testing, ensuring environments match production and catching containerization issues early.

Core Features & Use Cases

  • Multi-stage build workflows for building and running PostgreSQL extensions in separate build and runtime images.
  • Guidance to avoid Alpine-based images and ensure glibc-based containers for cdylib extensions, with tips for memory configuration and user switching.
  • Use cases include developing, testing, and validating .so/cdylib extensions with pg_regress in CI pipelines.

Quick Start

Build a Docker image that includes PostgreSQL development headers and use pg_regress to validate your extension.

Frequently Asked Questions about docker-pg

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test PostgreSQL extensions in Docker CI pipelines?

Test PostgreSQL extensions in Docker by automating multi-stage builds, configuring dynamic_shared_memory_type, and running pg_regress against your compiled extension to validate changes in CI pipelines.

Why does my PostgreSQL cdylib extension fail to load in an Alpine Docker container?

PostgreSQL cdylib extensions often fail in Alpine Docker containers because Alpine uses musl instead of glibc. You should use Debian-based glibc images to ensure proper symbol exports and reliable loading.

Can I run pg_regress inside a Docker container for extension integration testing?

Yes, you can run pg_regress inside Docker containers by building a runtime image with PostgreSQL development headers, allowing gosu or su-exec user switching to execute the test suite reliably.

What is the best way to configure dynamic_shared_memory_type for PostgreSQL extension testing in Docker?

Configuring dynamic_shared_memory_type in Docker involves setting it appropriately during the PostgreSQL setup phase inside the container to ensure shared memory allocation works correctly for extension testing.

Do I need multi-stage Docker builds for PostgreSQL extension development and testing?

Multi-stage Docker builds are recommended for PostgreSQL extension development to separate the build environment with development headers from the runtime environment, ensuring clean and reproducible test runs.