From 3e9883080b9c81309c0516f31a35c6cce9b8624c Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 9 Oct 2018 12:52:56 +0200 Subject: [PATCH] Update Dockerfile Signed-off-by: Knut Ahlers --- Dockerfile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index e47026b..820ce72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,25 @@ -FROM golang:alpine +FROM golang:alpine as builder -MAINTAINER Knut Ahlers - -ADD . /go/src/github.com/Luzifer/badge-gen +COPY . /go/src/github.com/Luzifer/badge-gen WORKDIR /go/src/github.com/Luzifer/badge-gen RUN set -ex \ - && apk add --update git ca-certificates \ - && go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" \ - && apk del --purge git + && apk add --update git \ + && go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" + +FROM alpine:latest + +LABEL maintainer "Knut Ahlers " + +RUN set -ex \ + && apk --no-cache add ca-certificates + +COPY --from=builder /go/bin/badge-gen /usr/local/bin/badge-gen EXPOSE 3000 - VOLUME ["/config"] -ENTRYPOINT ["/go/bin/badge-gen"] +ENTRYPOINT ["/usr/local/bin/badge-gen"] CMD ["--config", "/config/config.yaml"] + +# vim: set ft=Dockerfile: