From 8732e097052716610342fc175c6239ff8335b83d Mon Sep 17 00:00:00 2001 From: Faustin Lammler Date: Mon, 17 Oct 2022 12:37:00 +0200 Subject: [PATCH] Add hadolint checker Fix some warnings/errors --- .github/workflows/ci.yml | 23 +++++++++++++---------- .hadolint.yaml | 4 ++++ 10.10/Dockerfile | 23 +++++++++++++++-------- 10.3/Dockerfile | 23 +++++++++++++++-------- 10.4/Dockerfile | 23 +++++++++++++++-------- 10.5/Dockerfile | 23 +++++++++++++++-------- 10.6/Dockerfile | 23 +++++++++++++++-------- 10.7/Dockerfile | 23 +++++++++++++++-------- 10.8/Dockerfile | 23 +++++++++++++++-------- 10.9/Dockerfile | 23 +++++++++++++++-------- Dockerfile.template | 23 +++++++++++++++-------- 11 files changed, 152 insertions(+), 82 deletions(-) create mode 100644 .hadolint.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bdd730..06aa31f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,20 +18,23 @@ on: defaults: run: - shell: 'bash -Eeuo pipefail -x {0}' + shell: "bash -Eeuo pipefail -x {0}" jobs: - - shellcheck: - name: Shellcheck + checks: + name: Checks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@master - with: - ignore_paths: initdb.d - ignore_names: generate-stackbrew-library.sh + - uses: actions/checkout@v2 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + with: + ignore_paths: initdb.d + ignore_names: generate-stackbrew-library.sh + - name: Run Hadolint + uses: hadolint/hadolint-action@v2.0.0 + with: + dockerfile: Dockerfile.template generate-jobs: name: Generate Jobs diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..882b300 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,4 @@ +--- +ignored: + - DL3008 + - DL4006 diff --git a/10.10/Dockerfile b/10.10/Dockerfile index 7c63b83..8848d64 100644 --- a/10.10/Dockerfile +++ b/10.10/Dockerfile @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures: amd64 arm64v8 ppc64le s390x ARG MARIADB_VERSION=1:10.10.1+maria~ubu2204 @@ -91,6 +97,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server" mysql-server/root_password password 'unused'; \ diff --git a/10.3/Dockerfile b/10.3/Dockerfile index d67c27d..e940d97 100644 --- a/10.3/Dockerfile +++ b/10.3/Dockerfile @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures: amd64 arm64v8 ppc64le ARG MARIADB_MAJOR=10.3 @@ -93,6 +99,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \ diff --git a/10.4/Dockerfile b/10.4/Dockerfile index 2cbdf04..890075c 100644 --- a/10.4/Dockerfile +++ b/10.4/Dockerfile @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures: amd64 arm64v8 ppc64le ARG MARIADB_MAJOR=10.4 @@ -93,6 +99,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \ diff --git a/10.5/Dockerfile b/10.5/Dockerfile index 282eec8..c0a66c3 100644 --- a/10.5/Dockerfile +++ b/10.5/Dockerfile @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures: amd64 arm64v8 ppc64le s390x ARG MARIADB_MAJOR=10.5 @@ -93,6 +99,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \ diff --git a/10.6/Dockerfile b/10.6/Dockerfile index af20838..a64b1c6 100644 --- a/10.6/Dockerfile +++ b/10.6/Dockerfile @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures: amd64 arm64v8 ppc64le s390x ARG MARIADB_MAJOR=10.6 @@ -93,6 +99,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \ diff --git a/10.7/Dockerfile b/10.7/Dockerfile index 97baad7..6ad57a5 100644 --- a/10.7/Dockerfile +++ b/10.7/Dockerfile @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures: amd64 arm64v8 ppc64le s390x ARG MARIADB_MAJOR=10.7 @@ -93,6 +99,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \ diff --git a/10.8/Dockerfile b/10.8/Dockerfile index 10cb569..488d5e9 100644 --- a/10.8/Dockerfile +++ b/10.8/Dockerfile @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures: amd64 arm64v8 ppc64le s390x ARG MARIADB_MAJOR=10.8 @@ -93,6 +99,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \ diff --git a/10.9/Dockerfile b/10.9/Dockerfile index 37c2273..fbf3c81 100644 --- a/10.9/Dockerfile +++ b/10.9/Dockerfile @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures: amd64 arm64v8 ppc64le s390x ARG MARIADB_VERSION=1:10.9.3+maria~ubu2204 @@ -91,6 +97,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server" mysql-server/root_password password 'unused'; \ diff --git a/Dockerfile.template b/Dockerfile.template index a2870bd..a79a735 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -15,6 +15,8 @@ RUN set -ex; \ # add gosu for easy step-down from root # https://github.com/tianon/gosu/releases ENV GOSU_VERSION 1.14 +# apt-mark manual "$savedAptMark" does not work +# hadolint ignore=SC2086 RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates; \ @@ -22,9 +24,10 @@ RUN set -eux; \ apt-get install -y --no-install-recommends wget; \ rm -rf /var/lib/apt/lists/*; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ - export GNUPGHOME="$(mktemp -d)"; \ + wget -q -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -q -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ @@ -61,14 +64,17 @@ ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 # sub rsa4096 2016-03-30 [E] RUN set -ex; \ - export GNUPGHOME="$(mktemp -d)"; \ + GNUPGHOME="$(mktemp -d)"; \ + export GNUPGHOME; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -fr "$GNUPGHOME"; \ - apt-key list + gpg --batch --export "$GPG_KEYS" > /etc/apt/trusted.gpg.d/mariadb.gpg; \ + if command -v gpgconf >/dev/null; then \ + gpgconf --kill all; \ + else \ + :; \ + fi # bashbrew-architectures:%%ARCHES%% ARG MARIADB_MAJOR=%%MARIADB_MAJOR%% @@ -93,6 +99,7 @@ RUN set -e;\ # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter +# hadolint ignore=DL3015 RUN set -ex; \ { \ echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \