Sign inSign up

infrastructureascode/postgres

By infrastructureascode

•Updated 5 months ago

SSL-enabled image based on the official Postgres image

Image
0

50K+

infrastructureascode/postgres repository overview

GHCR Build Status Docker Hub Build Status

⁠Postgres Docker Image with Self-Signed SSL Certs

The official Postgres image⁠ comes without any SSL certificates, leaving users to create the functionality for themselves. This image strives to provide that missing functionality by using self-signed SSL certificates. It is available on both GitHub Container Register (ghcr.io) and Docker Hub (hub.docker.com).

⁠Automated Builds

In order to ensure the provenance of the images, all images are automatically built and pushed by GitHub Actions⁠ with every push to the main branch of this repo. Weekly builds are kicked off on Saturdays at 00:30 UTC so that we get all the upstream updates to the postgres image.

⁠Multiarch

Images are built for the following architecture.

  1. amd64
  2. arm32v6
  3. arm32v7
  4. arm64v8

⁠Images

Registry NameImage Name
GitHub Container Registryghcr.io/infrastructure-as-code/postgres
Docker Hubinfrastructureascode/postgres

⁠Supported Tags and Respective Dockerfiles

⁠Usage

Starting a container.

docker run --rm -it \
  -e POSTGRES_PASSWORD=password \
  ghcr.io/infrastructure-as-code/postgres:15-alpine

⁠Environment Variables

Since this image is extended from the official Postgresql images, it also has the same basic funcationality as the official images, so please review the instructions from the official image⁠ as well.

Additionally, the following environment variables provide a little bit of control of the self-signed SSL certificates.

Environment VariableDefault ValueDescription
SSL_DOMAINpg.localThe domain used in the self-signed SSL certificate
SSL_DAYS3650The number of days the self-signed SSL certificates are valid for
SSL_ONLYtrueShould all connections be SSL-only?

⁠Security Note

Self-signed SSL certifications are generated when a container is started for the first time (so that at least we don't all have the same certificates).

Please make sure you understand the security implications of using self-signed certificates of you use this for anything other than dev or test purposes. The Postgresql libpq-ssl⁠ page has a nice table describing the SSL modes that you should review.

⁠References

  1. https://gist.github.com/mrw34/c97bb03ea1054afb551886ffc8b63c3b⁠
  2. https://www.postgresql.org/docs/11/ssl-tcp.html⁠
  3. https://www.postgresql.org/docs/11/libpq-ssl.html#LIBPQ-SSL-PROTECTION⁠

Tag summary

Content type

Image

Digest

sha256:3698894f7…

Size

171.5 MB

Last updated

5 months ago

docker pull infrastructureascode/postgres