Skip to content

Commit 5a7e929

Browse files
docker: add Dockerfile and .dockerignore.
The Dockerfile produces a scratch image with a statically linked binary without debug flag.
1 parent 6411d31 commit 5a7e929

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.dockerignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
!go.mod
3+
!go.sum
4+
!*.go
5+
!Makefile
6+
!internal/*

Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM golang:1.14 AS builder
2+
WORKDIR /go/src/github.com/adnanh/webhook/
3+
COPY . ./
4+
RUN make CGO_ENABLED=0 LDFLAGS="-w -s" build
5+
6+
FROM scratch
7+
COPY --from=builder /go/src/github.com/adnanh/webhook/webhook /bin/
8+
ENTRYPOINT ["/bin/webhook"]

0 commit comments

Comments
 (0)