Improve Dockerfile

This commit is contained in:
Knut Ahlers 2018-05-17 17:34:32 +02:00
parent 456805c249
commit 29c6c77217
No known key found for this signature in database
GPG key ID: 4B5A4A2644A025A2
2 changed files with 7 additions and 6 deletions

View file

@ -1,13 +1,14 @@
FROM alpine
FROM alpine:latest
LABEL maintainer "Knut Ahlers <knut@luzifer.io>"
ENV VAULT_VERSION 0.10.1
ENV VAULT_HASH 031e521b4603487126fd353a9557dd22a02304a8a11f843e9914be59a8009c8a
ENV VAULT_VERSION=0.10.1 \
VAULT_HASH=031e521b4603487126fd353a9557dd22a02304a8a11f843e9914be59a8009c8a \
HOME=/home/vault
RUN set -xe \
&& apk --no-cache add curl ca-certificates \
&& curl -sSLfo /tmp/vault.zip https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip \
&& curl -sSLfo /tmp/vault.zip "https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip" \
&& echo "${VAULT_HASH} /tmp/vault.zip" | sha256sum -c \
&& mkdir -p /opt/vault \
&& unzip /tmp/vault.zip -d /opt/vault && rm /tmp/vault.zip \

View file

@ -21,8 +21,8 @@ echo "Testing availability of archive 'vault_${LATEST}_linux_amd64.zip'..."
curl -sSLIfo /dev/null https://releases.hashicorp.com/vault/${LATEST}/vault_${LATEST}_linux_amd64.zip
echo "Found version ${LATEST}, patching..."
sed -i "s/ENV VAULT_VERSION .*$/ENV VAULT_VERSION ${LATEST}/" Dockerfile
sed -i "s/ENV VAULT_HASH .*$/ENV VAULT_HASH ${SHASUM}/" Dockerfile
sed -i -E "s/VAULT_VERSION=[^ ]*/VAULT_VERSION=${LATEST}/" Dockerfile
sed -i -E "s/VAULT_HASH=[^ ]*/VAULT_HASH=${SHASUM}/" Dockerfile
echo "Checking for changes..."
git diff --exit-code && exit 0