docker: add Dockerfile and .dockerignore.
The Dockerfile produces a scratch image with a statically linked binary without debug flag.
This commit is contained in:
parent
6411d3182f
commit
f1c1110f20
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@ -0,0 +1,6 @@
|
||||
*
|
||||
!go.mod
|
||||
!go.sum
|
||||
!*.go
|
||||
!Makefile
|
||||
!internal/*
|
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@ -0,0 +1,8 @@
|
||||
FROM golang:1.15 AS builder
|
||||
WORKDIR /go/src/github.com/adnanh/webhook/
|
||||
COPY . ./
|
||||
RUN make CGO_ENABLED=0 LDFLAGS="-w -s" build
|
||||
|
||||
FROM scratch
|
||||
COPY --from=builder /go/src/github.com/adnanh/webhook/webhook /bin/
|
||||
ENTRYPOINT ["/bin/webhook"]
|
Loading…
Reference in New Issue
Block a user