Add Dockerfile for building standalone image
This commit is contained in:
parent
868b496858
commit
e13d65bbb8
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
short
|
17
Dockerfile
Normal file
17
Dockerfile
Normal 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" ]
|
Loading…
x
Reference in New Issue
Block a user