diff options
author | Alexander Kiryukhin <alexander@kiryukhin.su> | 2019-01-31 01:02:31 +0300 |
---|---|---|
committer | Alexander Kiryukhin <alexander@kiryukhin.su> | 2019-01-31 01:02:31 +0300 |
commit | 91c16487472cb23671ffdc9c230120441f85b620 (patch) | |
tree | 7454aa0053a2b613ff02c3a75db8bc5e09d6b5b2 /Dockerfile |
Initial commit
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5e60af2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# STEP 1 +FROM golang:1.11-stretch as builder +COPY . /srv/app +WORKDIR /srv/app +#get dependancies +RUN go mod download +#build the binary +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o /go/bin/app + +# STEP 2 +# start from scratch +FROM scratch +# Copy our static executable +WORKDIR /usr/app +COPY --from=builder /go/bin/app . +ENTRYPOINT ["./app"]
\ No newline at end of file |