Docker: Run a SHA-512 check on the downloaded archive.

This ensures that our Docker image is 100% reproducibly built with the tested and intended version of the Factorio headless binary package.
0.13.20
Icedream 2017-01-27 20:20:51 +01:00
parent bc931a0c63
commit e03bfc5295
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 4 additions and 0 deletions

View File

@ -2,10 +2,14 @@ FROM debian:jessie-slim
ARG FACTORIO_VERSION=0.14.21 ARG FACTORIO_VERSION=0.14.21
ARG FACTORIO_HEADLESS_URL=https://www.factorio.com/get-download/${FACTORIO_VERSION}/headless/linux64 ARG FACTORIO_HEADLESS_URL=https://www.factorio.com/get-download/${FACTORIO_VERSION}/headless/linux64
ARG FACTORIO_HEADLESS_SHA512=8a7f1e1214b1bbe79e34abadefcc6083be3830822dbe4570ce7fd96d26c6188460c134a0d53207b4e144022792adf1ff6514caf22d7f01ab106cf2d1c01bc2b1
# Unpack and reconfigure Factorio # Unpack and reconfigure Factorio
ADD ${FACTORIO_HEADLESS_URL} /var/tmp/factorio.tar.gz ADD ${FACTORIO_HEADLESS_URL} /var/tmp/factorio.tar.gz
RUN \ RUN \
echo "${FACTORIO_HEADLESS_SHA512} /var/tmp/factorio.tar.gz" |\
sha512sum -c --strict - &&\
\
mkdir -p /opt &&\ mkdir -p /opt &&\
tar vxf /var/tmp/*.tar* -C /opt/ &&\ tar vxf /var/tmp/*.tar* -C /opt/ &&\
rm -rf /var/tmp/* /tmp/* &&\ rm -rf /var/tmp/* /tmp/* &&\