Skip to content

Add support for PG 11.1 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions 11.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Postgres with ssl enabled
# Uses a self signed cert, not for production use
FROM postgres:11.1
LABEL maintainer "https://github.com/muccg/"

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ssl-cert \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ADD docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
10 changes: 10 additions & 0 deletions 11.1/docker-entrypoint-initdb.d/devssl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

cd "${PGDATA}"
cp /etc/ssl/certs/ssl-cert-snakeoil.pem "${PGDATA}"/server.crt
cp /etc/ssl/private/ssl-cert-snakeoil.key "${PGDATA}"/server.key
chmod og-rwx server.key
chown -R postgres:postgres "${PGDATA}"

# turn on ssl
sed -ri "s/^#?(ssl\s*=\s*)\S+/\1'on'/" "$PGDATA/postgresql.conf"
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Uses a self signed cert, not for production use.
$ docker-compose up

# Connect using stardard postgres client, will verify SSL connection to console.
$ docker run -it --network host --rm postgres:11.1 psql -h localhost -U postgres -p 5435 template1
$ docker run -it --network host --rm postgres:9.6 psql -h localhost -U postgres -p 5434 template1
$ docker run -it --network host --rm postgres:9.5 psql -h localhost -U postgres -p 5433 template1
$ docker run -it --network host --rm postgres:9.4 psql -h localhost -U postgres template1
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ services:
image: muccg/postgres-ssl:9.6
ports:
- 5434:5432

'11.1':
image: muccg/postgres-ssl:11.1
ports:
- 5435:5432