Skip to content

Commit 9dcc169

Browse files
authored
Merge pull request #44 from patricklodder/fix/docker-lint-fixes
Fix recommendations from hadolint
2 parents 95135b3 + cc93b80 commit 9dcc169

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

1.14.5/bullseye/Dockerfile

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ ARG RLS_OS=linux
1313
ARG RLS_LIB=gnu
1414
ARG RLS_ARCH=
1515

16+
# configure the shell before the first RUN
17+
SHELL ["/bin/bash", "-ex", "-o", "pipefail", "-c"]
18+
1619
# pin known sha256sums
1720
RUN echo f3bc387f393a0d55b6f653aef24febef6cb6f352fab2cbb0bae420bddcdacd1c dogecoin-1.14.5-aarch64-linux-gnu.tar.gz > SHASUMS \
1821
&& echo dfdcdc6bb36076e7634cc8ed89138ec0383d73ba42b3e7ecfa9279b8949bce6b dogecoin-1.14.5-arm-linux-gnueabihf.tar.gz >> SHASUMS \
@@ -37,23 +40,25 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
3740
RUN git clone --depth 1 ${REPO_GITIAN_BUILDER} gitian \
3841
&& git clone --depth 1 ${REPO_GITIAN_SIGS} sigs \
3942
&& git clone --depth 1 -b v${RLS_VERSION} ${REPO_DOGECOIN_CORE} dogecoin \
40-
&& find dogecoin/contrib/gitian-keys -name "*.pgp" |xargs -n 1 gpg --import
43+
&& find dogecoin/contrib/gitian-keys -name "*.pgp" -exec gpg --import {} +
4144

4245
# determine architecture, download release binary
4346
# and verify against random OK signer and pinned shasums
44-
RUN set -ex && ARCHITECTURE=$(dpkg --print-architecture) \
47+
RUN ARCHITECTURE=$(dpkg --print-architecture) \
4548
&& if [ "${ARCHITECTURE}" = "amd64" ]; then RLS_ARCH=x86_64 ; fi \
4649
&& if [ "${ARCHITECTURE}" = "arm64" ]; then RLS_ARCH=aarch64; fi \
4750
&& if [ "${ARCHITECTURE}" = "armhf" ]; then RLS_ARCH=arm && RLS_LIB=gnueabihf; fi \
4851
&& if [ "${ARCHITECTURE}" = "i386" ]; then RLS_ARCH=i686-pc; fi \
4952
&& if [ "${RLS_ARCH}" = "" ]; then echo "Could not determine architecture" >&2; exit 1; fi \
50-
&& RLS_FILE_NAME=dogecoin-${RLS_VERSION}-${RLS_ARCH}-${RLS_OS}-${RLS_LIB}.tar.gz \
51-
&& wget ${RLS_LOCATION}/${RLS_FILE_NAME} \
52-
&& gitian/bin/gverify --no-markup -d sigs -r ${SIG_PATH} ${DESCRIPTOR_PATH} \
53-
| grep OK | shuf -n 1 | sed s/:.*// > random_signer.txt \
54-
&& grep ${RLS_FILE_NAME} sigs/${SIG_PATH}/$(cat random_signer.txt)/*assert | sha256sum -c \
55-
&& grep ${RLS_FILE_NAME} SHASUMS | sha256sum -c \
56-
&& mv ${RLS_FILE_NAME} dogecoin.tar.gz
53+
&& RLS_FILE_NAME="dogecoin-${RLS_VERSION}-${RLS_ARCH}-${RLS_OS}-${RLS_LIB}.tar.gz" \
54+
&& wget -q --show-progress --progress=bar:force:noscroll "${RLS_LOCATION}/${RLS_FILE_NAME}" \
55+
&& GITIAN_OUTPUT=$(gitian/bin/gverify --no-markup -d sigs -r "${SIG_PATH}" "${DESCRIPTOR_PATH}") || true \
56+
&& RANDOM_SIGNER=$(echo "${GITIAN_OUTPUT}" | grep OK | shuf -n 1 | sed s/:.*//) \
57+
&& if [ "${RANDOM_SIGNER}" = "" ]; then echo "No valid signers found" >&2; exit 1; fi \
58+
&& echo "Checking against signer: ${RANDOM_SIGNER}" \
59+
&& grep "${RLS_FILE_NAME}" sigs/"${SIG_PATH}"/"${RANDOM_SIGNER}"/*assert | sha256sum -c \
60+
&& grep "${RLS_FILE_NAME}" SHASUMS | sha256sum -c \
61+
&& mv "${RLS_FILE_NAME}" dogecoin.tar.gz
5762

5863
FROM debian:bullseye-slim AS final
5964

@@ -76,7 +81,7 @@ RUN tar -xvf dogecoin.tar.gz --strip-components=1 \
7681
&& cp bin/dogecoind bin/dogecoin-cli bin/dogecoin-tx /usr/local/bin/ \
7782
&& chown ${USER}:${USER} /usr/local/bin/dogecoin* \
7883
&& chmod 4555 /usr/local/bin/dogecoin* \
79-
&& rm -rf *
84+
&& rm -rf -- *
8085

8186
WORKDIR ${HOME}
8287

0 commit comments

Comments
 (0)