HUB
Sign inSign up

msecapps/pgbouncer

By msecapps

•Updated 2 days ago

Image
Developer tools
Databases & storage
0

600

msecapps/pgbouncer repository overview

⁠PgBouncer Distroless

[TR] Distroless tabanı üzerine inşa edilmiş minimal PgBouncer imajları. Shell, paket yöneticisi ve gereksiz binary dosyaları içermez; üretim ortamları için saldırı yüzeyi en aza indirilmiştir.

[EN] Minimal PgBouncer images built on a Distroless base. They contain no shell, package manager or unnecessary binaries, keeping the attack surface to a minimum for production environments.


⁠🏷 Etiketler / Tags

Etiket / TagTaban / BaseBağlama / LinkingAçıklama / Description
latestgcr.io/distroless/base-debian13:nonrootDinamik / DynamicDebian 13 kütüphaneleri (glibc, OpenSSL) kullanır. / Uses Debian 13 libraries (glibc, OpenSSL).
staticgcr.io/distroless/static-debian13:nonrootStatik / StaticAlpine (musl) ile derlenmiş tek binary; imajda glibc veya OpenSSL paketi yoktur. / Single binary built with Alpine (musl); the image contains no glibc or OpenSSL packages.

[TR] Hangisini seçmeliyim? Debian paket ekosistemine bağlı kalmak istiyorsanız latest; en küçük imajı ve en temiz güvenlik taramasını istiyorsanız static.

[EN] Which one should I use? Choose latest to stay on Debian's package ecosystem; choose static for the smallest image and the cleanest security scan.

[TR] Not: static imajında OpenSSL, libevent ve c-ares binary'nin içine gömülüdür. Tarayıcılar (Trivy vb.) bu kütüphaneleri paket olarak göremez; imaj, kütüphanelerin güncel kalması için düzenli olarak yeniden derlenir.

[EN] Note: In the static image, OpenSSL, libevent and c-ares are embedded in the binary. Scanners (Trivy, etc.) cannot see these libraries as packages; the image is rebuilt regularly to keep them up to date.


⁠🚀 Özellikler / Features

  • Güvenlik (Security): Distroless tabanlıdır, C++ çalışma zamanı kütüphaneleri (libstdc++, libgcc) içermez. / Distroless based, without C++ runtime libraries (libstdc++, libgcc).
  • Hafiflik (Lightweight): Yalnızca PgBouncer ve gerekli kütüphaneleri (libevent, c-ares, OpenSSL) içerir. / Contains only PgBouncer and its required libraries (libevent, c-ares, OpenSSL).
  • Yetkisiz Kullanıcı (Non-Root): nonroot kullanıcısı (UID 65532) ile çalışır. / Runs as the nonroot user (UID 65532).
  • Güncel (Up to date): Her build'de en güncel güvenlik yamaları alınır ve imaj Trivy ile taranır. / Every build pulls the latest security patches and is scanned with Trivy.
Bileşen / Componentlateststatic
PgBouncer1.26.11.26.1
libevent2.1.13-stable2.1.13-stable
c-ares1.34.91.34.9
OpenSSL3.5.73.5.9
C kütüphanesi / C libraryglibc 2.41musl

⁠🛠 Kullanım / Usage

⁠1. Yapılandırma / Configuration

[TR] Distroless imajda dosya sistemi kısıtlıdır. pidfile ve unix_socket_dir yolları yazma izni olan /tmp dizinine yönlendirilmelidir.

[EN] The filesystem is restricted in Distroless. pidfile and unix_socket_dir must point to /tmp, which is writable.

pgbouncer.ini:

[pgbouncer]
listen_addr = 0.0.0.0
listen_port = 6432
auth_file = /etc/pgbouncer/userlist.txt
unix_socket_dir = /tmp
pidfile = /tmp/pgbouncer.pid
⁠2. Çalıştırma / Running

[TR] Aşağıdaki örneklerde latest yerine static etiketini de kullanabilirsiniz.

[EN] You can use the static tag instead of latest in the examples below.

Bash/Terminal

docker run -d \
  --name pgbouncer \
  -p 6432:6432 \
  -v $(pwd)/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro \
  -v $(pwd)/userlist.txt:/etc/pgbouncer/userlist.txt:ro \
  msecapps/pgbouncer:latest

Docker Compose

services:
  pgbouncer:
    image: msecapps/pgbouncer:latest   # veya / or: msecapps/pgbouncer:static
    container_name: pgbouncer
    ports:
      - "6432:6432"
    volumes:
      - ./pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro
      - ./userlist.txt:/etc/pgbouncer/userlist.txt:ro
    restart: always
⁠3. Yönetim Konsolu / Admin Console

[TR] İmajlarda psql bulunmaz. Yönetim konsoluna kendi makinenizden veya geçici bir konteynerden bağlanın (kullanıcı pgbouncer.ini içindeki admin_users listesinde olmalıdır):

[EN] The images do not include psql. Connect to the admin console from your own machine or a temporary container (the user must be listed in admin_users in pgbouncer.ini):

docker run --rm -it postgres:18-alpine \
  psql -h <pgbouncer-host> -p 6432 -U <admin_user> pgbouncer -c "SHOW POOLS;"
⁠4. Sağlık Kontrolü / Health Check

[TR] İmajlarda shell olmadığı için HEALTHCHECK komutu kullanılamaz. Kubernetes'te TCP kontrolü önerilir:

[EN] Since the images have no shell, HEALTHCHECK commands cannot be used. In Kubernetes, use a TCP probe:

livenessProbe:
  tcpSocket:
    port: 6432

⁠🔍 Sürüm Kontrolü / Version Check

docker run --rm msecapps/pgbouncer:latest --version
docker run --rm msecapps/pgbouncer:static --version

Maintainer: Github⁠.

Tag summary

Content type

Image

Digest

sha256:992a99a68…

Size

11 MB

Last updated

2 days ago

docker pull msecapps/pgbouncer