FROM ubuntu:14.04 MAINTAINER [email protected]
ENV POSTGRESQL_VERSION=9.5
RUN
apt-get update &&
apt-get install -y wget &&
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - &&
apt-get update &&
echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list &&
apt-get update &&
apt-get install -y python-software-properties software-properties-common
postgresql-${POSTGRESQL_VERSION} postgresql-client-${POSTGRESQL_VERSION}
postgresql-contrib-${POSTGRESQL_VERSION}
postgres user created by the postgres-9.3 package when it was apt-get installedUSER postgres
docker with docker as the password anddocker owned by the docker role.&&\ to run commands one after the other - the \RUN /etc/init.d/postgresql start &&
psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&
createdb -O docker docker
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/${POSTGRESQL_VERSION}/main/pg_hba.conf
listen_addresses to /etc/postgresql/${POSTGRESQL_VERSION}/main/postgresql.confRUN echo "listen_addresses='*'" >> /etc/postgresql/${POSTGRESQL_VERSION}/main/postgresql.conf
EXPOSE 5432
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
CMD /usr/lib/postgresql/${POSTGRESQL_VERSION}/bin/postgres -D /var/lib/postgresql/${POSTGRESQL_VERSION}/main -c config_file=/etc/postgresql/${POSTGRESQL_VERSION}/main/postgresql.conf
Content type
Image
Digest
Size
121 MB
Last updated
over 10 years ago
docker pull jackyyu/postgresql:9.5