From 05f603c56f4ac8e4a685d9585e2a257201bac6ba Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 28 Jun 2016 19:40:45 +0200 Subject: [PATCH] Update Dockerfile to build binary in container --- Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 63bfc36..ca7b1ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,16 @@ -FROM gliderlabs/alpine:3.1 +FROM golang:alpine MAINTAINER Knut Ahlers -RUN apk --update add wget && \ - wget --no-check-certificate https://gobuilder.me/get/github.com/Luzifer/badge-gen/badge-gen_master_linux-386.zip && \ - unzip badge-gen_master_linux-386.zip +ADD . /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 -ENV PORT 3000 EXPOSE 3000 -ENTRYPOINT ["/badge-gen/badge-gen"] + +ENTRYPOINT ["/go/bin/badge-gen"] +CMD ["--"]