Improve container size and build process

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-01-13 13:16:22 +01:00
parent 5937b139d9
commit d9f968892f
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -5,14 +5,14 @@ LABEL maintainer "Knut Ahlers <knut@luzifer.io>"
ENV VAULT_VERSION 0.9.1
ENV VAULT_HASH 6308013ee0d6278e98cdfe8d6de0162102a8d25f3bcd1e3737bf7b022a9f6702
ADD https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip /tmp/vault.zip
RUN set -xe \
&& apk add --update ca-certificates \
&& 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 \
&& echo "${VAULT_HASH} /tmp/vault.zip" | sha256sum -c \
&& mkdir -p /opt/vault \
&& unzip /tmp/vault.zip -d /opt/vault \
&& unzip /tmp/vault.zip -d /opt/vault && rm /tmp/vault.zip \
&& ln -sf /opt/vault/vault /usr/local/bin/vault \
&& apk --no-cache del curl \
&& adduser -D -u 1000 vault
USER vault