Updated Dockerfile

Due to the renaming of Governor to Patroni some old references needed to be updated.
Also some python packages need to be added.

Added entrypoint.sh as a script, to ensure Patroni will have PID = 1 when the container is run.
This commit is contained in:
Feike Steenbergen
2015-08-05 09:56:32 +02:00
parent 6fdd0304f6
commit 7c4efb33e7
2 changed files with 13 additions and 9 deletions
+10 -9
View File
@@ -1,4 +1,4 @@
## This Dockerfile is meant to aid in the building and debugging governor whilst developing on your local machine ## This Dockerfile is meant to aid in the building and debugging patroni whilst developing on your local machine
## It has all the necessary components to play/debug with a single node appliance, running etcd ## It has all the necessary components to play/debug with a single node appliance, running etcd
FROM ubuntu:14.04 FROM ubuntu:14.04
MAINTAINER Feike Steenbergen <[email protected]> MAINTAINER Feike Steenbergen <[email protected]>
@@ -13,22 +13,23 @@ RUN apt-get update -y
RUN apt-get upgrade -y RUN apt-get upgrade -y
ENV PGVERSION 9.4 ENV PGVERSION 9.4
RUN apt-get install python python-psycopg2 python-yaml python-requests python-boto postgresql-${PGVERSION} python-dnspython -y RUN apt-get install python python-psycopg2 python-yaml python-requests python-boto postgresql-${PGVERSION} python-dnspython python-pip -y
RUN pip install zake
ENV PATH /usr/lib/postgresql/${PGVERSION}/bin:$PATH ENV PATH /usr/lib/postgresql/${PGVERSION}/bin:$PATH
RUN mkdir -p /governor/helpers RUN mkdir -p /patroni/helpers
ADD governor.py /governor/governor.py ADD patroni.py /patroni/patroni.py
ADD helpers /governor/helpers ADD helpers /patroni/helpers
ADD postgres0.yml /governor/ ADD postgres0.yml /patroni/
ENV ETCDVERSION 2.0.12 ENV ETCDVERSION 2.0.12
RUN curl -L https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-amd64.tar.gz | tar xz -C /bin --strip=1 --wildcards --no-anchored etcd etcdctl RUN curl -L https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-amd64.tar.gz | tar xz -C /bin --strip=1 --wildcards --no-anchored etcd etcdctl
## Setting up a simple script that will serve as an entrypoint ## Setting up a simple script that will serve as an entrypoint
RUN mkdir /data/ && touch /var/log/etcd.log /var/log/etcd.err && chown postgres:postgres /var/log/etcd.* RUN mkdir /data/ && touch /var/log/etcd.log /var/log/etcd.err && chown postgres:postgres /var/log/etcd.*
RUN chown postgres:postgres -R /governor/ /data/ RUN chown postgres:postgres -R /patroni/ /data/
RUN /bin/echo -e "etcd --data-dir /tmp/etcd.data > /var/log/etcd.log 2> /var/log/etcd.err &\n/governor/governor.py /governor/postgres0.yml \"\$@\"" >> /entrypoint.sh && chmod +x /entrypoint.sh ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT /entrypoint.sh ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
USER postgres USER postgres
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
etcd --data-dir /tmp/etcd.data > /var/log/etcd.log 2> /var/log/etcd.err &
exec /patroni/patroni.py /patroni/postgres0.yml "$@"