Skip to content
This repository has been archived by the owner on Aug 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #8 from ymatsiuk/master
Browse files Browse the repository at this point in the history
Reduce docker image size to ~14MB
  • Loading branch information
amouat committed Aug 31, 2020
2 parents 4461149 + 290d940 commit 35e8852
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.7-alpine

RUN mkdir /app
FROM golang:1.7-alpine AS builder
COPY . /go/src/github.com/weaveworks/prometheus-swarm/

RUN echo http:https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories
RUN apk update && apk add glide git
RUN cd /go/src/github.com/weaveworks/prometheus-swarm/ && glide install

RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app/main /go/src/github.com/weaveworks/prometheus-swarm/swarm.go

ENTRYPOINT ["/app/main", "discover"]
RUN echo "http:https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk --update add glide git \
&& cd /go/src/github.com/weaveworks/prometheus-swarm/ \
&& mkdir /app \
&& glide install \
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app/main /go/src/github.com/weaveworks/prometheus-swarm/swarm.go

FROM alpine:3.6
COPY --from=builder /app/main /promswarm
ENTRYPOINT ["/promswarm", "discover"]

0 comments on commit 35e8852

Please sign in to comment.