From 55b4034696ebb067543700757e822db9a67ab0bc Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Mon, 9 Nov 2020 18:27:44 -0800 Subject: [PATCH] Add dockerfile --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3267a17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.15 as build +WORKDIR /netauth/ldap +COPY . . +RUN go mod vendor && \ + CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o /ldapd . + +FROM scratch +ENTRYPOINT ["/ldapd"] +COPY --from=build /ldapd /ldapd