Add Dockerfile for building standalone image

This commit is contained in:
Tom Andrade 2019-03-18 16:23:39 +01:00
parent 868b496858
commit e13d65bbb8
Signed by: wolvie
GPG Key ID: 31AAB07872E82669
2 changed files with 18 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
short

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM golang:1.12.1 as builder
ENV CGO_ENABLED=0
ADD . /go/src/short
WORKDIR /go/src/short
RUN go get ./... && go build -o short .
FROM scratch
LABEL maintainer="Thomas Andrade <wolvie@gmail.com>"
COPY --from=builder /go/src/short/short /
ENTRYPOINT [ "/short" ]