Skip to content

Commit

Permalink
updating Dockerfile for multistage build
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanejohnson committed Dec 9, 2020
1 parent 6ae6804 commit d8759e6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Dockerfile
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"]

0 comments on commit d8759e6

Please sign in to comment.