From 96e0a2659576318ebf691de48f797532fe703139 Mon Sep 17 00:00:00 2001 From: Pierre-Gildas MILLON <715479+pgmillon@users.noreply.github.com> Date: Sun, 26 Dec 2021 19:43:53 +0100 Subject: [PATCH 1/3] Add mariadb-connector-c for sha256_passwords --- core/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Dockerfile b/core/Dockerfile index 9b2cd532..0b35dd57 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/root/.cache \ && apk add --virtual build-deps gcc python3-dev musl-dev postgresql-dev \ libffi-dev \ # psutil needs linux-headers to compile on musl c library. - && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers \ + && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers mariadb-connector-c \ && python3 -m pip install -U pip setuptools wheel \ && python3 -m pip install psycopg2 \ gunicorn==19.9.0 \ From e79800f49b76c67811e1e11643c618ca697c0507 Mon Sep 17 00:00:00 2001 From: Pierre-Gildas MILLON <715479+pgmillon@users.noreply.github.com> Date: Sun, 26 Dec 2021 19:44:29 +0100 Subject: [PATCH 2/3] Improve MySQL endpoint ping with custom ports --- core/docker-entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/docker-entrypoint.sh b/core/docker-entrypoint.sh index 38338ad5..9c6ab170 100755 --- a/core/docker-entrypoint.sh +++ b/core/docker-entrypoint.sh @@ -15,8 +15,8 @@ function wait_for_postgres () { function wait_for_mysql () { # Check if MySQL is up and accepting connections. - HOSTNAME=$(python3 -c "from urllib.parse import urlparse; o = urlparse('$DATABASE_URL'); print(o.hostname);") - until mysqladmin ping --host "$HOSTNAME" --silent; do + readarray -d' ' -t ENDPOINT <<< $(python3 -c "from urllib.parse import urlparse; o = urlparse('$DATABASE_URL'); print('%s %s' % (o.hostname, o.port if o.port else '3306'));") + until mysqladmin ping --host ${ENDPOINT[0]} --port ${ENDPOINT[1]} --silent; do >&2 echo "MySQL is unavailable - sleeping" sleep 1 done From 3fbb7e641c98e5930566f079503458dc3bf70871 Mon Sep 17 00:00:00 2001 From: Pierre-Gildas MILLON <715479+pgmillon@users.noreply.github.com> Date: Sun, 2 Jan 2022 10:26:20 +0100 Subject: [PATCH 3/3] Update web & postorius images with similar changes as core --- core/Dockerfile.dev | 2 +- postorius/Dockerfile | 2 +- postorius/Dockerfile.dev | 2 +- postorius/docker-entrypoint.sh | 13 ++----------- web/Dockerfile | 2 +- web/Dockerfile.dev | 2 +- web/docker-entrypoint.sh | 13 ++----------- 7 files changed, 9 insertions(+), 27 deletions(-) diff --git a/core/Dockerfile.dev b/core/Dockerfile.dev index 20a391f2..66eb78ac 100644 --- a/core/Dockerfile.dev +++ b/core/Dockerfile.dev @@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/root/.cache \ apk update \ && apk add --no-cache --virtual build-deps gcc python3-dev musl-dev \ postgresql-dev git libffi-dev \ - && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers \ + && apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers mariadb-connector-c \ && python3 -m pip install -U psycopg2 pymysql setuptools wheel \ && python3 -m pip install \ git+https://gitlab.com/mailman/mailman@${CORE_REF} \ diff --git a/postorius/Dockerfile b/postorius/Dockerfile index f8d719b4..2d235b45 100644 --- a/postorius/Dockerfile +++ b/postorius/Dockerfile @@ -12,7 +12,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ RUN --mount=type=cache,target=/root/.cache \ set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \ - postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ + postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap gettext \ python3 py3-pip libffi libuuid pcre-dev \ diff --git a/postorius/Dockerfile.dev b/postorius/Dockerfile.dev index f1560cb3..f6bf5faf 100644 --- a/postorius/Dockerfile.dev +++ b/postorius/Dockerfile.dev @@ -16,7 +16,7 @@ ARG CLIENT_REF RUN --mount=type=cache,target=/root/.cache \ set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \ - postgresql-dev mariadb-dev python3-dev libffi-dev git cargo rust \ + postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev git cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap \ python3 py3-pip libffi gettext \ diff --git a/postorius/docker-entrypoint.sh b/postorius/docker-entrypoint.sh index 26c7e381..2b8218b7 100755 --- a/postorius/docker-entrypoint.sh +++ b/postorius/docker-entrypoint.sh @@ -16,23 +16,14 @@ function wait_for_postgres () { function wait_for_mysql () { # Check if MySQL is up and accepting connections. - HOSTNAME=$(python3 <&2 echo "MySQL is unavailable - sleeping" sleep 1 done >&2 echo "MySQL is up - continuing" } - function check_or_create () { # Check if the path exists, if not, create the directory. if [[ ! -e dir ]]; then diff --git a/web/Dockerfile b/web/Dockerfile index 011b4c58..ff3cf592 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -12,7 +12,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ RUN --mount=type=cache,target=/root/.cache \ set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \ - postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ + postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py3-mysqlclient curl mailcap gettext \ python3 py3-pip xapian-core xapian-bindings-python3 libffi pcre-dev \ diff --git a/web/Dockerfile.dev b/web/Dockerfile.dev index 2c5951c7..426e1951 100644 --- a/web/Dockerfile.dev +++ b/web/Dockerfile.dev @@ -17,7 +17,7 @@ ARG CLIENT_REF RUN --mount=type=cache,target=/root/.cache \ set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers git \ - postgresql-dev mariadb-dev python3-dev libffi-dev openldap-dev cargo rust \ + postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev openldap-dev cargo rust \ && apk add --no-cache --virtual .mailman-rundeps bash sassc pcre-dev \ python3 py3-pip postgresql-client mysql-client py3-mysqlclient \ curl mailcap xapian-core xapian-bindings-python3 libffi gettext \ diff --git a/web/docker-entrypoint.sh b/web/docker-entrypoint.sh index a02691cf..a29c3962 100755 --- a/web/docker-entrypoint.sh +++ b/web/docker-entrypoint.sh @@ -16,23 +16,14 @@ function wait_for_postgres () { function wait_for_mysql () { # Check if MySQL is up and accepting connections. - HOSTNAME=$(python3 <&2 echo "MySQL is unavailable - sleeping" sleep 1 done >&2 echo "MySQL is up - continuing" } - function check_or_create () { # Check if the path exists, if not, create the directory. if [[ ! -e dir ]]; then