From 6adef5e0cb899546497392c03adb693a50b986c6 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Fri, 6 Jul 2018 13:09:46 -0400 Subject: [PATCH] fix vault Signed-off-by: Jess Frazelle --- vault/Dockerfile | 54 +++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/vault/Dockerfile b/vault/Dockerfile index e88708f..6ab92a0 100644 --- a/vault/Dockerfile +++ b/vault/Dockerfile @@ -1,38 +1,36 @@ -FROM alpine:latest -LABEL maintainer "Jessie Frazelle " +FROM golang:alpine as builder +MAINTAINER Jessica Frazelle ENV PATH /go/bin:/usr/local/go/bin:$PATH ENV GOPATH /go -RUN apk --no-cache add \ - ca-certificates +RUN apk add --no-cache \ + --repository https://dl-3.alpinelinux.org/alpine/edge/main/ \ + bash \ + ca-certificates \ + git \ + make \ + npm \ + yarn \ + zip ENV VAULT_VERSION v0.10.3 -RUN buildDeps=' \ - bash \ - go \ - git \ - gcc \ - g++ \ - libc-dev \ - libgcc \ - make \ - yarn \ - zip \ - ' \ - set -x \ - && apk --no-cache add --repository https://dl-3.alpinelinux.org/alpine/edge/community $buildDeps \ - && mkdir -p /go/src/github.com/hashicorp \ - && git clone --depth 1 --branch ${VAULT_VERSION} https://github.com/hashicorp/vault /go/src/github.com/hashicorp/vault \ - && cd /go/src/github.com/hashicorp/vault \ - && go get github.com/mitchellh/gox \ - && yarn global add bower \ - && XC_ARCH="amd64" XC_OS="linux" XC_OSARCH="linux/amd64" make bootstrap static-dist bin \ - && mv bin/vault /usr/bin/ \ - && apk del $buildDeps \ - && rm -rf /go \ - && echo "Build complete." +RUN go get github.com/hashicorp/vault +WORKDIR /go/src/github.com/hashicorp/vault + +RUN git checkout "${VAULT_VERSION}" + +#RUN yarn global add bower + +RUN XC_ARCH="amd64" XC_OS="linux" XC_OSARCH="linux/amd64" LD_FLAGS=" -extldflags -static " make bootstrap static-dist bin \ + && mv bin/vault /usr/bin/vault + +FROM alpine:latest + +COPY --from=builder /usr/bin/vault /usr/bin/vault +COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs ENTRYPOINT [ "vault" ] +CMD [ "--help" ]