Skip to content

Commit d1a779c

Browse files
committed
Init
1 parent a292815 commit d1a779c

5 files changed

Lines changed: 163 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: daily

.github/workflows/docker.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "Docker"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
8+
schedule:
9+
- cron: "0 8 * * 1"
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
PGBOUNCER_VERSION: "1.25.1"
16+
17+
jobs:
18+
test:
19+
name: "Test"
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v6
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v4
27+
28+
- name: Build image for testing
29+
uses: docker/build-push-action@v7
30+
with:
31+
context: ./pgbouncer
32+
file: ./pgbouncer/Dockerfile
33+
push: false
34+
tags: dockette/pgbouncer:${{ env.PGBOUNCER_VERSION }}-test
35+
platforms: linux/amd64
36+
load: true
37+
build-args: |
38+
PGBOUNCER_VERSION=${{ env.PGBOUNCER_VERSION }}
39+
cache-from: type=gha
40+
cache-to: type=gha,mode=max
41+
42+
- name: Smoke test image
43+
run: docker run --rm dockette/pgbouncer:${{ env.PGBOUNCER_VERSION }}-test pgbouncer --version
44+
45+
build:
46+
name: "Build"
47+
needs: test
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v6
52+
53+
- name: Login to DockerHub
54+
uses: docker/login-action@v4
55+
with:
56+
username: ${{ secrets.DOCKERHUB_USERNAME }}
57+
password: ${{ secrets.DOCKERHUB_TOKEN }}
58+
59+
- name: Set up Docker Buildx
60+
uses: docker/setup-buildx-action@v4
61+
62+
- name: Build and push
63+
uses: docker/build-push-action@v7
64+
with:
65+
context: ./pgbouncer
66+
file: ./pgbouncer/Dockerfile
67+
push: ${{ github.ref == 'refs/heads/master' }}
68+
tags: |
69+
dockette/pgbouncer:${{ env.PGBOUNCER_VERSION }}
70+
dockette/pgbouncer:latest
71+
platforms: linux/amd64
72+
build-args: |
73+
PGBOUNCER_VERSION=${{ env.PGBOUNCER_VERSION }}
74+
cache-from: type=gha
75+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG PGBOUNCER_VERSION=1.25.1
2+
3+
FROM dhi.io/pgbouncer:${PGBOUNCER_VERSION}
4+
5+
ARG PGBOUNCER_VERSION
6+
7+
LABEL maintainer="Milan Sulc <sulcmil@gmail.com>"
8+
LABEL org.opencontainers.image.title="PgBouncer"
9+
LABEL org.opencontainers.image.description="Thin republish of dhi.io/pgbouncer for Dockette"
10+
LABEL org.opencontainers.image.version="${PGBOUNCER_VERSION}"
11+
LABEL org.opencontainers.image.source="https://github.com/dockette/pgbouncer"

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
DOCKER_IMAGE=dockette/pgbouncer
2+
DOCKER_TAG?=1.25.1
3+
DOCKER_PLATFORMS?=linux/amd64
4+
5+
.PHONY: build
6+
build:
7+
docker buildx build --platform ${DOCKER_PLATFORMS} \
8+
--build-arg PGBOUNCER_VERSION=${DOCKER_TAG} \
9+
-t ${DOCKER_IMAGE}:${DOCKER_TAG} \
10+
.
11+
12+
.PHONY: test
13+
test:
14+
docker run --rm --platform ${DOCKER_PLATFORMS} ${DOCKER_IMAGE}:${DOCKER_TAG} pgbouncer --version

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<h1 align=center>Dockette / PgBouncer</h1>
2+
3+
<p align=center>
4+
Minimal Docker image for <a href="https://www.pgbouncer.org/">PgBouncer</a>, a connection pooler for PostgreSQL. This tag mirrors <code>dhi.io/pgbouncer</code> under the <code>dockette/pgbouncer</code> name on Docker Hub.
5+
</p>
6+
7+
<p align=center>
8+
🕹 <a href="https://f3l1x.io">f3l1x.io</a> | 💻 <a href="https://github.com/f3l1x">f3l1x</a> | 🐦 <a href="https://twitter.com/xf3l1x">@xf3l1x</a>
9+
</p>
10+
11+
<p align=center>
12+
<a href="https://hub.docker.com/r/dockette/pgbouncer/"><img src="https://badgen.net/docker/pulls/dockette/pgbouncer"></a>
13+
<a href="https://bit.ly/ctteg"><img src="https://badgen.net/badge/support/gitter/cyan"></a>
14+
<a href="https://github.com/sponsors/f3l1x"><img src="https://badgen.net/badge/sponsor/donations/F96854"></a>
15+
</p>
16+
17+
-----
18+
19+
## Usage
20+
21+
Mount your `pgbouncer.ini` (and optional userlist) and expose the pool port (default **6432**):
22+
23+
```sh
24+
docker run --name some-pgbouncer -p 6432:6432 \
25+
-v /path/to/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro \
26+
dockette/pgbouncer:1.25.1
27+
```
28+
29+
Minimal `pgbouncer.ini` sketch (adjust `host`, auth, and pool names for your setup):
30+
31+
```ini
32+
[databases]
33+
* = host=postgres port=5432
34+
35+
[pgbouncer]
36+
listen_addr = 0.0.0.0
37+
listen_port = 6432
38+
auth_type = md5
39+
auth_file = /etc/pgbouncer/userlist.txt
40+
pool_mode = transaction
41+
max_client_conn = 100
42+
default_pool_size = 20
43+
```
44+
45+
## Versions
46+
47+
| Image tag | Equivalent upstream | Docker Hub |
48+
|-----------|---------------------|------------|
49+
| `dockette/pgbouncer:1.25.1` | `dhi.io/pgbouncer:1.25.1` | [tags](https://hub.docker.com/r/dockette/pgbouncer/tags/) |
50+
| `dockette/pgbouncer:latest` | same as `1.25.1` (rolling) | [tags](https://hub.docker.com/r/dockette/pgbouncer/tags/) |
51+
52+
The image is a thin republish: builds use `FROM dhi.io/pgbouncer:${PGBOUNCER_VERSION}` so runtime behavior matches that upstream tag.
53+
54+
-----
55+
56+
Consider supporting [f3l1x on GitHub Sponsors](https://github.com/sponsors/f3l1x) if you rely on this. Thanks for using it.

0 commit comments

Comments
 (0)