Public | Automated Build

Last pushed: 2 years ago
# Postgresql ( FROM phusion/baseimage:0.9.13 MAINTAINER Ryan Seto <> # Ensure we create the cluster with UTF-8 locale RUN locale-gen en_US.UTF-8 && \ echo 'LANG="en_US.UTF-8"' > /etc/default/locale # Disable SSH (Not using it at the moment). RUN rm -rf /etc/service/sshd /etc/my_init.d/ # Install the latest postgresql RUN echo "deb trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ apt-get update && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y --force-yes \ postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 && \ /etc/init.d/postgresql stop # Install other tools. RUN DEBIAN_FRONTEND=noninteractive apt-get install -y pwgen inotify-tools # Clean up APT when done. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Cofigure the database to use our data dir. RUN sed -i -e"s/data_directory =.*$/data_directory = '\/data'/" /etc/postgresql/9.3/main/postgresql.conf # Allow connections from anywhere. RUN sed -i -e"s/^#listen_addresses =.*$/listen_addresses = '*'/" /etc/postgresql/9.3/main/postgresql.conf RUN echo "host all all md5" >> /etc/postgresql/9.3/main/pg_hba.conf EXPOSE 5432 ADD scripts /scripts RUN chmod +x /scripts/ RUN touch /firstrun # Add daemon to be run by runit. RUN mkdir /etc/service/postgresql RUN ln -s /scripts/ /etc/service/postgresql/run # Expose our data, log, and configuration directories. VOLUME ["/data", "/var/log/postgresql", "/etc/postgresql"] # Use baseimage-docker's init system. CMD ["/sbin/my_init"]
Source Repository