From 99f011801720025b0b3930aab4595b68170f5580 Mon Sep 17 00:00:00 2001 From: Michael Rennecke Date: Sun, 6 Aug 2017 22:12:19 +0200 Subject: [PATCH] use alpine as base for build stage --- carbonapi/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/carbonapi/Dockerfile b/carbonapi/Dockerfile index 5042a23..545171e 100644 --- a/carbonapi/Dockerfile +++ b/carbonapi/Dockerfile @@ -1,11 +1,14 @@ -FROM golang:1.8 as builder +# Stage: Build +FROM golang:1.8-alpine as builder ENV VERSION=0.8.0 -RUN mkdir -p /go/src +RUN set -x \ + && apk --update add git RUN set -x \ + && mkdir -p /go/src \ && cd /go/src \ && git clone https://github.com/go-graphite/carbonapi.git @@ -15,10 +18,10 @@ RUN git checkout ${VERSION} RUN go-wrapper download -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o carbonapi . - +RUN go build +# Stage: Run FROM alpine COPY --from=builder /go/src/carbonapi/carbonapi /sbin/