Skip to content

Commit

Permalink
fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kozmagabor committed Oct 4, 2018
1 parent 0a798b0 commit ef5b0d8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# build stage
FROM golang:1.9.3-alpine3.7
FROM golang:1.9.3-alpine3.7 as backend
RUN apk update && apk add ca-certificates curl git make tzdata

ADD . /go/src/github.com/banzaicloud/spot-price-exporter
RUN mkdir -p /go/src/github.com/banzaicloud/spot-price-exporter
ADD Gopkg.* Makefile /go/src/github.com/banzaicloud/spot-price-exporter/
WORKDIR /go/src/github.com/banzaicloud/spot-price-exporter

RUN make vendor
ADD . /go/src/github.com/banzaicloud/spot-price-exporter

RUN go build -o /bin/spot-price-exporter .

FROM alpine:latest
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*

FROM alpine:3.7
COPY --from=backend /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /bin/spot-price-exporter /bin
ENTRYPOINT ["/bin/spot-price-exporter"]

0 comments on commit ef5b0d8

Please sign in to comment.