Fix some small issues in the Dockerfile (#1074)

* symlink ~/.config/patroni/patronictl.yaml
* comment out rewind section
This commit is contained in:
Alexander Kukushkin
2019-05-28 14:47:46 +02:00
committed by GitHub
parent b291291ff6
commit 3b90cc1931
+2 -2
View File
@@ -43,7 +43,7 @@ RUN set -ex \
\ \
# Prepare postgres/patroni/haproxy environment # Prepare postgres/patroni/haproxy environment
&& mkdir -p $PGHOME/.config/patroni /patroni /run/haproxy \ && mkdir -p $PGHOME/.config/patroni /patroni /run/haproxy \
&& ln -s ../../patroni.yaml $PGHOME/.config/patroni/patronictl.yaml \ && ln -s ../../postgres0.yml $PGHOME/.config/patroni/patronictl.yaml \
&& ln -s /patronictl.py /usr/local/bin/patronictl \ && ln -s /patronictl.py /usr/local/bin/patronictl \
&& sed -i "s|/var/lib/postgresql.*|$PGHOME:/bin/bash|" /etc/passwd \ && sed -i "s|/var/lib/postgresql.*|$PGHOME:/bin/bash|" /etc/passwd \
&& chown -R postgres:postgres /var/log \ && chown -R postgres:postgres /var/log \
@@ -146,7 +146,7 @@ RUN sed -i 's/env python/&3/' /patroni*.py \
&& sed -i "s|^#\( bin_dir: \).*|\1$PGBIN|" postgres?.yml \ && sed -i "s|^#\( bin_dir: \).*|\1$PGBIN|" postgres?.yml \
&& sed -i 's/^ - encoding: UTF8/ - locale: en_US.UTF-8\n&/' postgres?.yml \ && sed -i 's/^ - encoding: UTF8/ - locale: en_US.UTF-8\n&/' postgres?.yml \
&& sed -i 's/^\(scope\|name\|etcd\| host\| authentication\| pg_hba\| parameters\):/#&/' postgres?.yml \ && sed -i 's/^\(scope\|name\|etcd\| host\| authentication\| pg_hba\| parameters\):/#&/' postgres?.yml \
&& sed -i 's/^ \(replication\|superuser\|unix_socket_directories\|\(\( \)\{0,1\}\(username\|password\)\)\):/#&/' postgres?.yml \ && sed -i 's/^ \(replication\|superuser\|rewind\|unix_socket_directories\|\(\( \)\{0,1\}\(username\|password\)\)\):/#&/' postgres?.yml \
&& sed -i 's/^ parameters:/ pg_hba:\n - local all all trust\n - host replication all all md5\n - host all all all md5\n&\n max_connections: 100/' postgres?.yml \ && sed -i 's/^ parameters:/ pg_hba:\n - local all all trust\n - host replication all all md5\n - host all all all md5\n&\n max_connections: 100/' postgres?.yml \
&& if [ "$COMPRESS" = "true" ]; then chmod u+s /usr/bin/sudo; fi \ && if [ "$COMPRESS" = "true" ]; then chmod u+s /usr/bin/sudo; fi \
&& chown -R postgres:postgres $PGHOME /run /etc/haproxy && chown -R postgres:postgres $PGHOME /run /etc/haproxy