Public | Automated Build

Last pushed: 8 months ago
Short Description
Based on https://github.com/hegand/pgpool and https://github.com/BetterVoice/pgpool2-container
Full Description

Pgpool2 Dockerfile

This project can be used to deploy pgpool2 inside a Docker container for transparent failover between two postgresql hosts without requiring a floating IP address.

It relies on Alpine Linux - Edge.

Tags and respective Dockerfile links

Current versions (latest)

Running the Container

Stand alone command line

sudo docker run --name pgpool2 -e PGPOOL_BACKENDS=1:127.0.0.1:5432,2:127.0.0.1:5433 -p 5432:5432/tcp manuc66/pgpool2-container-alpine:latest

With docker-compose

version: '3'
services:
  mypostgres:
    image: postgres:9.6-alpine

  pgpool2:
    image: manuc66/pgpool2-container-alpine:latest
    depends_on: 
      - mypostgres
    environment:
      - PGPOOL_BACKENDS=1:mypostgres:5432
    ports:
      - 5432:5432/tcp

Configuration Environment Variables

PCP_PORT - The port used to listen for PCP commands. (default: 9898)

PCP_USER - The user allowed to execute PCP commands. (default: postgres)

PCP_USER_PASSWORD - The pcp user password. (default: bettervoice)

PGPOOL_PORT - The port used by pgpool2 to listen for client connections. (default: 5432)

PGPOOL_BACKENDS - A comma separated list of PostgeSQL server backends. The format for each backend is as follows: INDEX:HOST:PORT (default: 1:localhost:5432)

Docker Pull Command
Owner
manuc66
Source Repository

Comments (1)
ca0abinary
7 months ago

Very cool stuff. A couple issues I've experienced:

  • There's no tag on docker hub for 3.6.0, so I tried latest and that pulled
  • latest returned an error: gosu not found
  • Used 3.5.4 with container links to primary and replica containers, but it seems like port 5432 isn't open (not exposed?)