From 4d9720a78d2c8beaa63f9a18b18a45f8aeb6d62c Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Wed, 12 Sep 2018 16:57:22 +0200 Subject: [PATCH] Use pg10 as base image and python3 instead of 2 --- kubernetes/Dockerfile | 10 +++++----- kubernetes/entrypoint.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kubernetes/Dockerfile b/kubernetes/Dockerfile index c6a97e0e..a2ef9434 100644 --- a/kubernetes/Dockerfile +++ b/kubernetes/Dockerfile @@ -5,20 +5,20 @@ RUN export DEBIAN_FRONTEND=noninteractive \ && echo 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01norecommend \ && apt-get update -y \ && apt-get upgrade -y \ - && apt-get install -y git curl jq python-psycopg2 python-yaml python-requests python-six \ - python-dateutil python-pip python-prettytable python-wheel python-psutil python locales \ + && apt-get install -s patroni | sed -n -e '/^Inst patroni /d' -e 's/^Inst \([^ ]\+\) .*$/\1/p' \ + | xargs apt-get install -y curl jq locales git python3-pip python3-wheel \ ## Make sure we have a en_US.UTF-8 locale available && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ - && pip install setuptools pip --upgrade \ - && pip install 'git+https://github.com/zalando/patroni.git#egg=patroni[kubernetes]' \ + && pip3 install setuptools \ + && pip3 install 'git+https://github.com/zalando/patroni.git#egg=patroni[kubernetes]' \ && mkdir -p /home/postgres \ && chown postgres:postgres /home/postgres \ # Clean up - && apt-get remove -y git python-pip python-setuptools \ + && apt-get remove -y git python3-pip python3-wheel \ && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* /root/.cache diff --git a/kubernetes/entrypoint.sh b/kubernetes/entrypoint.sh index f018ad90..c34f225d 100755 --- a/kubernetes/entrypoint.sh +++ b/kubernetes/entrypoint.sh @@ -20,4 +20,4 @@ postgresql: connect_address: '${PATRONI_KUBERNETES_POD_IP}:5432' __EOF__ -exec /usr/bin/python /usr/local/bin/patroni /home/postgres/patroni.yml +exec /usr/bin/python3 /usr/local/bin/patroni /home/postgres/patroni.yml