-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating Dockerfile for multistage build
- Loading branch information
1 parent
6ae6804
commit d8759e6
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
FROM golang:alpine AS build-stage | ||
WORKDIR /go/src/consul-backinator | ||
COPY . . | ||
RUN apk add --no-cache --no-progress ca-certificates tzdata git musl-dev && \ | ||
go install | ||
|
||
|
||
|
||
FROM alpine:latest | ||
ENV GOPATH /opt/go | ||
ENV SRCPATH $GOPATH/src/github.com/myENA/consul-backinator | ||
COPY . $SRCPATH | ||
|
||
WORKDIR /usr/local/bin | ||
COPY --from=build-stage /go/bin/consul-backinator ./ | ||
RUN \ | ||
apk add --no-cache --no-progress ca-certificates bash git glide go musl-dev && \ | ||
mkdir -p $GOPATH/bin && \ | ||
export PATH=$GOPATH/bin:$PATH && \ | ||
cd $SRCPATH && \ | ||
chmod +x build/build.sh && \ | ||
build/build.sh -i && \ | ||
mv consul-backinator /usr/local/bin/consul-backinator && \ | ||
apk del --no-cache --no-progress --purge bash git glide go musl-dev && \ | ||
rm -rf $GOPATH /tmp/* /root/.glide | ||
apk add --no-cache --no-progress ca-certificates tzdata | ||
ENTRYPOINT ["/usr/local/bin/consul-backinator"] |