Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 415b445

Browse files
committed
Add 9.2
1 parent 6fabe2e commit 415b445

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

9.2/Dockerfile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM debian:wheezy
2+
3+
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
4+
RUN groupadd -r postgres && useradd -r -g postgres postgres
5+
6+
RUN apt-get update && apt-get install -y curl
7+
8+
RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \
9+
&& chmod +x /usr/local/bin/gosu
10+
11+
ENV PG_MAJOR 9.2
12+
ENV PG_VERSION 9.2.8-1.pgdg70+1
13+
14+
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \
15+
&& curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \
16+
| apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764
17+
18+
RUN apt-get update \
19+
&& apt-get install -y postgresql-common \
20+
&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
21+
&& apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION
22+
23+
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
24+
ENV PGDATA /var/lib/postgresql/data
25+
VOLUME /var/lib/postgresql/data
26+
27+
ADD ./docker-entrypoint.sh /
28+
29+
ENTRYPOINT ["/docker-entrypoint.sh"]
30+
31+
EXPOSE 5432
32+
CMD ["postgres"]

9.2/docker-entrypoint.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ "$1" = 'postgres' ]; then
5+
chown -R postgres "$PGDATA"
6+
7+
if [ -z "$(ls -A "$PGDATA")" ]; then
8+
gosu postgres initdb
9+
10+
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
11+
12+
{ echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf
13+
fi
14+
15+
exec gosu postgres "$@"
16+
fi
17+
18+
exec "$@"

0 commit comments

Comments
 (0)