From 71c75671d521e5ccb1f659d64672cf5066b824d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 13 Jul 2019 12:23:01 +0200 Subject: [PATCH] Add debug code when sha match fails --- 0.17/Dockerfile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/0.17/Dockerfile b/0.17/Dockerfile index 8e76e2c..43951fc 100644 --- a/0.17/Dockerfile +++ b/0.17/Dockerfile @@ -19,14 +19,16 @@ ENV PORT=34197 \ PUID="$PUID" \ PGID="$PGID" -RUN mkdir -p /opt /factorio \ - && apk add --update --no-cache --no-progress bash binutils curl gettext jq libintl pwgen shadow su-exec \ - && curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" \ - -o /tmp/factorio_headless_x64_$VERSION.tar.xz \ - && echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.xz" | sha1sum -c \ - && tar xf "/tmp/factorio_headless_x64_$VERSION.tar.xz" --directory /opt \ +RUN set -ox pipefail \ + && archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \ + && mkdir -p /opt /factorio \ + && apk add --update --no-cache --no-progress bash binutils curl file gettext jq libintl pwgen shadow su-exec \ + && curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" -o "$archive" \ + && echo "$SHA1 $archive" | sha1sum -c \ + || (sha1sum "$archive" && file "$archive" && exit 1) \ + && tar xf "$archive" --directory /opt \ && chmod ugo=rwx /opt/factorio \ - && rm "/tmp/factorio_headless_x64_$VERSION.tar.xz" \ + && rm "$archive" \ && ln -s "$SAVES" /opt/factorio/saves \ && ln -s "$MODS" /opt/factorio/mods \ && ln -s "$SCENARIOS" /opt/factorio/scenarios \