From cc9b71d4a9f908d5242f4dc07188b88f32526d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Molinero=20Fern=C3=A1ndez?= Date: Thu, 20 May 2021 22:48:10 +0200 Subject: [PATCH] Add .sql.zst support to docker-entrypoint-initdb.d --- 10.2/Dockerfile | 2 ++ 10.2/docker-entrypoint.sh | 9 +++++---- 10.3/Dockerfile | 2 ++ 10.3/docker-entrypoint.sh | 9 +++++---- 10.4/Dockerfile | 2 ++ 10.4/docker-entrypoint.sh | 9 +++++---- 10.5/Dockerfile | 2 ++ 10.5/docker-entrypoint.sh | 9 +++++---- 10.6/Dockerfile | 2 ++ 10.6/docker-entrypoint.sh | 9 +++++---- Dockerfile.template | 2 ++ docker-entrypoint.sh | 9 +++++---- 12 files changed, 42 insertions(+), 24 deletions(-) diff --git a/10.2/Dockerfile b/10.2/Dockerfile index ac2a5ef0..33aa5f57 100644 --- a/10.2/Dockerfile +++ b/10.2/Dockerfile @@ -46,12 +46,14 @@ RUN mkdir /docker-entrypoint-initdb.d # install "pwgen" for randomizing passwords # install "tzdata" for /usr/share/zoneinfo/ # install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files +# install "zstd" for .sql.zst docker-entrypoint-initdb.d files RUN set -ex; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ pwgen \ tzdata \ xz-utils \ + zstd \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/10.2/docker-entrypoint.sh b/10.2/docker-entrypoint.sh index f6545350..0cb71cd1 100755 --- a/10.2/docker-entrypoint.sh +++ b/10.2/docker-entrypoint.sh @@ -81,10 +81,11 @@ docker_process_init_files() { . "$f" fi ;; - *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; - *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; - *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; - *) mysql_warn "$0: ignoring $f" ;; + *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; + *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; + *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; + *.sql.zst) mysql_note "$0: running $f"; zstd -dc "$f" | docker_process_sql; echo ;; + *) mysql_warn "$0: ignoring $f" ;; esac echo done diff --git a/10.3/Dockerfile b/10.3/Dockerfile index 32032a3b..7c3b946c 100644 --- a/10.3/Dockerfile +++ b/10.3/Dockerfile @@ -46,12 +46,14 @@ RUN mkdir /docker-entrypoint-initdb.d # install "pwgen" for randomizing passwords # install "tzdata" for /usr/share/zoneinfo/ # install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files +# install "zstd" for .sql.zst docker-entrypoint-initdb.d files RUN set -ex; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ pwgen \ tzdata \ xz-utils \ + zstd \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/10.3/docker-entrypoint.sh b/10.3/docker-entrypoint.sh index f6545350..0cb71cd1 100755 --- a/10.3/docker-entrypoint.sh +++ b/10.3/docker-entrypoint.sh @@ -81,10 +81,11 @@ docker_process_init_files() { . "$f" fi ;; - *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; - *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; - *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; - *) mysql_warn "$0: ignoring $f" ;; + *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; + *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; + *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; + *.sql.zst) mysql_note "$0: running $f"; zstd -dc "$f" | docker_process_sql; echo ;; + *) mysql_warn "$0: ignoring $f" ;; esac echo done diff --git a/10.4/Dockerfile b/10.4/Dockerfile index b2587f38..571c66cb 100644 --- a/10.4/Dockerfile +++ b/10.4/Dockerfile @@ -46,12 +46,14 @@ RUN mkdir /docker-entrypoint-initdb.d # install "pwgen" for randomizing passwords # install "tzdata" for /usr/share/zoneinfo/ # install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files +# install "zstd" for .sql.zst docker-entrypoint-initdb.d files RUN set -ex; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ pwgen \ tzdata \ xz-utils \ + zstd \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/10.4/docker-entrypoint.sh b/10.4/docker-entrypoint.sh index f6545350..0cb71cd1 100755 --- a/10.4/docker-entrypoint.sh +++ b/10.4/docker-entrypoint.sh @@ -81,10 +81,11 @@ docker_process_init_files() { . "$f" fi ;; - *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; - *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; - *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; - *) mysql_warn "$0: ignoring $f" ;; + *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; + *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; + *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; + *.sql.zst) mysql_note "$0: running $f"; zstd -dc "$f" | docker_process_sql; echo ;; + *) mysql_warn "$0: ignoring $f" ;; esac echo done diff --git a/10.5/Dockerfile b/10.5/Dockerfile index dc1a357f..538919c2 100644 --- a/10.5/Dockerfile +++ b/10.5/Dockerfile @@ -46,12 +46,14 @@ RUN mkdir /docker-entrypoint-initdb.d # install "pwgen" for randomizing passwords # install "tzdata" for /usr/share/zoneinfo/ # install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files +# install "zstd" for .sql.zst docker-entrypoint-initdb.d files RUN set -ex; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ pwgen \ tzdata \ xz-utils \ + zstd \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/10.5/docker-entrypoint.sh b/10.5/docker-entrypoint.sh index f6545350..0cb71cd1 100755 --- a/10.5/docker-entrypoint.sh +++ b/10.5/docker-entrypoint.sh @@ -81,10 +81,11 @@ docker_process_init_files() { . "$f" fi ;; - *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; - *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; - *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; - *) mysql_warn "$0: ignoring $f" ;; + *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; + *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; + *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; + *.sql.zst) mysql_note "$0: running $f"; zstd -dc "$f" | docker_process_sql; echo ;; + *) mysql_warn "$0: ignoring $f" ;; esac echo done diff --git a/10.6/Dockerfile b/10.6/Dockerfile index 12e7eb19..6f5480ab 100644 --- a/10.6/Dockerfile +++ b/10.6/Dockerfile @@ -46,12 +46,14 @@ RUN mkdir /docker-entrypoint-initdb.d # install "pwgen" for randomizing passwords # install "tzdata" for /usr/share/zoneinfo/ # install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files +# install "zstd" for .sql.zst docker-entrypoint-initdb.d files RUN set -ex; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ pwgen \ tzdata \ xz-utils \ + zstd \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/10.6/docker-entrypoint.sh b/10.6/docker-entrypoint.sh index f6545350..0cb71cd1 100755 --- a/10.6/docker-entrypoint.sh +++ b/10.6/docker-entrypoint.sh @@ -81,10 +81,11 @@ docker_process_init_files() { . "$f" fi ;; - *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; - *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; - *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; - *) mysql_warn "$0: ignoring $f" ;; + *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; + *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; + *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; + *.sql.zst) mysql_note "$0: running $f"; zstd -dc "$f" | docker_process_sql; echo ;; + *) mysql_warn "$0: ignoring $f" ;; esac echo done diff --git a/Dockerfile.template b/Dockerfile.template index 0658c01e..eb9e7dd1 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -46,12 +46,14 @@ RUN mkdir /docker-entrypoint-initdb.d # install "pwgen" for randomizing passwords # install "tzdata" for /usr/share/zoneinfo/ # install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files +# install "zstd" for .sql.zst docker-entrypoint-initdb.d files RUN set -ex; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ pwgen \ tzdata \ xz-utils \ + zstd \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index f6545350..0cb71cd1 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -81,10 +81,11 @@ docker_process_init_files() { . "$f" fi ;; - *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; - *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; - *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; - *) mysql_warn "$0: ignoring $f" ;; + *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; + *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; + *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; + *.sql.zst) mysql_note "$0: running $f"; zstd -dc "$f" | docker_process_sql; echo ;; + *) mysql_warn "$0: ignoring $f" ;; esac echo done