mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
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:
+10
-9
@@ -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
|
||||
FROM ubuntu:14.04
|
||||
MAINTAINER Feike Steenbergen <[email protected]>
|
||||
@@ -13,22 +13,23 @@ RUN apt-get update -y
|
||||
RUN apt-get upgrade -y
|
||||
|
||||
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
|
||||
|
||||
RUN mkdir -p /governor/helpers
|
||||
ADD governor.py /governor/governor.py
|
||||
ADD helpers /governor/helpers
|
||||
ADD postgres0.yml /governor/
|
||||
RUN mkdir -p /patroni/helpers
|
||||
ADD patroni.py /patroni/patroni.py
|
||||
ADD helpers /patroni/helpers
|
||||
ADD postgres0.yml /patroni/
|
||||
|
||||
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
|
||||
|
||||
## 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 chown postgres:postgres -R /governor/ /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
|
||||
RUN chown postgres:postgres -R /patroni/ /data/
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT /entrypoint.sh
|
||||
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
|
||||
USER postgres
|
||||
|
||||
Executable
+3
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user