mirror of
https://github.com/adnanh/webhook.git
synced 2025-08-01 15:30:30 +00:00
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
2 changed files with 14 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue