HUB
Sign inSign up

msecapps/postgres

By msecapps

•Updated 2 days ago

Image
Databases & storage
0

1.4K

msecapps/postgres repository overview

⁠PostgreSQL (patched)

[TR] Resmi postgres imajıyla birebir aynı şekilde çalışan, ancak güncel işletim sistemi güvenlik yamalarını ve güncel Go sürümüyle yeniden derlenmiş gosu aracını içeren PostgreSQL imajı. Debian ve Alpine varyantları vardır. Resmi imajın yerine doğrudan kullanılabilir (drop-in replacement).

[EN] A PostgreSQL image that behaves exactly like the official postgres image, but includes the latest OS security patches and gosu rebuilt with a current Go release. Available in Debian and Alpine variants. It can be used as a drop-in replacement for the official image.


⁠🏷 Etiketler / Tags

⁠Debian 13
Etiket / TagPostgreSQLTaban / Base
19.0, 19, latest19.0postgres:19.0
18.7, 1818.7postgres:18.7
⁠Alpine 3.24
Etiket / TagPostgreSQLTaban / Base
19.0-alpine3.24, 19.0-alpine, 19-alpine, alpine19.0postgres:19.0-alpine3.24
18.7-alpine3.24, 18.7-alpine, 18-alpine18.7postgres:18.7-alpine3.24

Platformlar / Platforms: linux/amd64, linux/arm64

⚠️ [TR] Mevcut bir veritabanında latest veya alpine etiketini kullanmayın. Ana sürümler (18 → 19) arasında veri formatı değişir; 18 ile oluşturulmuş veri klasörü 19 ile açılmaz. Geçiş için pg_upgrade veya dump/restore gerekir. Ana sürümü sabitleyin: msecapps/postgres:18 veya msecapps/postgres:18-alpine.

⚠️ [EN] Do not use the latest or alpine tags with an existing database. The data format changes between major versions (18 → 19); a data directory created with 18 cannot be opened by 19. Upgrading requires pg_upgrade or dump/restore. Pin the major version: msecapps/postgres:18 or msecapps/postgres:18-alpine.


⁠🐧 Debian mı Alpine mı? / Debian or Alpine?

DebianAlpine
C kütüphanesi / C libraryglibcmusl
Boyut / SizeDaha büyük / LargerDaha küçük / Smaller
Paket sayısı / Package countDaha fazla / MoreDaha az / Fewer
Resmi postgres:18 imajından geçiş / Migrating from official postgres:18✅ Sadece image: değişir / Only image: changes❌ Dump/restore gerekir / Requires dump/restore
Yeni kurulum / New installation✅✅

⚠️ [TR] Debian'dan Alpine'a doğrudan geçmeyin. glibc ve musl metinleri farklı sıralar (collation). Debian imajıyla oluşturulmuş bir veri klasörünü Alpine imajıyla açarsanız metin sütunlarındaki indeksler sessizce bozulabilir; sorgular hata vermeden yanlış veya eksik sonuç döndürür. Alpine varyantını yalnızca yeni veritabanları için kullanın; mevcut bir veritabanını taşımak için pg_dump / pg_restore kullanın. Aynı uyarı ters yön (Alpine → Debian) için de geçerlidir.

⚠️ [EN] Do not switch directly from Debian to Alpine. glibc and musl sort text differently (collation). If you open a data directory created by the Debian image with the Alpine image, indexes on text columns can silently break; queries return wrong or incomplete results without any error. Use the Alpine variant only for new databases; use pg_dump / pg_restore to move an existing one. The same applies in the other direction (Alpine → Debian).


⁠🔒 Resmi imajdan farkları / Differences from the official image

Resmi / Official postgresmsecapps/postgres
İşletim sistemi paketleri / OS packagesİmajın yayınlandığı tarihteki hâli / As of image releaseapt-get upgrade / apk upgrade ile güncel / Upgraded
gosuEski Go sürümüyle derlenmiş / Built with an older Go releaseGüncel Go ve golang.org/x/sys ile yeniden derlenmiş / Rebuilt with current Go and golang.org/x/sys
ssl-cert-snakeoil.key (Debian)Var / PresentKaldırıldı / Removed
Giriş betiği, ortam değişkenleri, davranış / Entrypoint, env vars, behavior—Değişmedi / Unchanged

[TR] gosu, konteynerin root olarak başlayıp postgres kullanıcısına geçmesini sağlayan küçük bir araçtır. Eski Go sürümüyle derlendiği için tarayıcılarda (Trivy vb.) çok sayıda Go standart kütüphanesi açığı olarak görünür. Bu imajda güncel Go ile yeniden derlenmiştir; davranışı aynıdır.

[EN] gosu is a small tool that lets the container start as root and switch to the postgres user. Because it was built with an older Go release, scanners (Trivy, etc.) report many Go standard library vulnerabilities. In this image it is rebuilt with a current Go release; its behavior is unchanged.

[TR] Debian varyantında, ssl-cert paketinin otomatik ürettiği test anahtarı PostgreSQL tarafından kullanılmadığı için kaldırılmıştır. Dosya resmi imajın alt katmanında bulunduğundan Trivy'nin secret taraması onu hâlâ raporlayabilir; çalışan konteynerde dosya yoktur. SSL kullanıyorsanız kendi sertifikanızı bağlayın.

[EN] In the Debian variant, the test key generated automatically by the ssl-cert package is removed, since PostgreSQL does not use it. Because the file exists in a lower layer of the official image, Trivy's secret scan may still report it; the file is not present in the running container. If you use SSL, mount your own certificate.


⁠🛠 Kullanım / Usage

[TR] Resmi postgres imajının belgelerindeki⁠ tüm ortam değişkenleri ve yöntemler aynen geçerlidir.

[EN] All environment variables and usage patterns from the official postgres image documentation⁠ apply unchanged.

⁠Docker
# Debian
docker run -d --name postgres \
  -e POSTGRES_PASSWORD=change-me \
  -v pgdata:/var/lib/postgresql \
  -p 5432:5432 \
  msecapps/postgres:18

# Alpine
docker run -d --name postgres \
  -e POSTGRES_PASSWORD=change-me \
  -v pgdata:/var/lib/postgresql \
  -p 5432:5432 \
  msecapps/postgres:18-alpine
⁠Docker Compose
services:
  postgresql:
    image: msecapps/postgres:18          # veya / or: msecapps/postgres:18-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER_FILE: /run/secrets/db_user
      POSTGRES_PASSWORD_FILE: /run/secrets/db_password
      POSTGRES_DB: mydb
    volumes:
      - ./postgres_data:/var/lib/postgresql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      retries: 30

[TR] PostgreSQL 18 ve sonrasında veri klasörü ana sürüme göre otomatik seçilir (/var/lib/postgresql/18/docker, /var/lib/postgresql/19/docker). PGDATA değişkenini elle tanımlarsanız sürüm numarasını doğru yazdığınızdan emin olun.

[EN] In PostgreSQL 18 and later, the data directory is chosen automatically by major version (/var/lib/postgresql/18/docker, /var/lib/postgresql/19/docker). If you set PGDATA manually, make sure the version number is correct.

⁠Resmi imajdan geçiş / Migrating from the official image

[TR] Aynı ana sürümde ve aynı varyantta kalıyorsanız (postgres:18.7 → msecapps/postgres:18.7 veya postgres:18.7-alpine → msecapps/postgres:18.7-alpine) yalnızca image: satırını değiştirmeniz yeterlidir. Taban imaj ve C kütüphanesi aynı olduğundan mevcut veri klasörü ve indeksler etkilenmez. Yine de geçişten önce yedek almanız önerilir.

[EN] If you stay on the same major version and the same variant (postgres:18.7 → msecapps/postgres:18.7 or postgres:18.7-alpine → msecapps/postgres:18.7-alpine), you only need to change the image: line. The base image and C library are the same, so the existing data directory and indexes are not affected. Taking a backup before switching is still recommended.


⁠🔍 Kontrol / Verification

docker run --rm msecapps/postgres:18 postgres --version
docker run --rm --entrypoint gosu msecapps/postgres:18 --version
trivy image --image-src remote --ignore-unfixed --scanners vuln msecapps/postgres:18
trivy image --image-src remote --ignore-unfixed --scanners vuln msecapps/postgres:18-alpine

⁠Lisans / License

[TR] Bu imaj; PostgreSQL (PostgreSQL License⁠), resmi Docker imajı (docker-library/postgres⁠, MIT) ve gosu⁠ (Apache-2.0) projelerini temel alır. Bu imaj resmi değildir ve bu projelerle bağlantılı değildir.

[EN] This image is based on PostgreSQL (PostgreSQL License⁠), the official Docker image (docker-library/postgres⁠, MIT) and gosu⁠ (Apache-2.0). This image is unofficial and not affiliated with these projects.

Maintainer: Github⁠.

Tag summary

Content type

Image

Digest

sha256:fd3c5884d…

Size

165.4 MB

Last updated

2 days ago

docker pull msecapps/postgres