diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..956a9c52 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +* +!go.mod +!go.sum +!*.go +!Makefile +!internal/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..abc7c9a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.14 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"]