Run "dep ensure" as part of docker build process

This commit is contained in:
2018-05-06 23:36:01 +01:00
parent f882e14b51
commit 0a09a1eaf0

View File

@@ -1,8 +1,15 @@
FROM golang:1.10-alpine as builder
ADD . /go/src/github.com/jimeh/casecmp
RUN set -e \
&& apk add --no-cache git \
&& wget -O - https://github.com/golang/dep/raw/master/install.sh | sh
WORKDIR /go/src/github.com/jimeh/casecmp
RUN CGO_ENABLED=0 go build -a -o /casecmp \
-ldflags "-X main.Version=$(cat VERSION)"
ADD . /go/src/github.com/jimeh/casecmp
RUN set -e \
&& dep ensure \
&& CGO_ENABLED=0 go build -a -o /casecmp \
-ldflags "-X main.Version=$(cat VERSION)"
FROM scratch
COPY --from=builder /casecmp /