ldap-upstream/Dockerfile

15 lines
427 B
Docker
Raw Normal View History

2020-11-11 00:59:53 -06:00
FROM golang:1.15-alpine as build
2020-11-09 20:27:44 -06:00
WORKDIR /netauth/ldap
COPY . .
RUN go mod vendor && \
2020-11-11 00:59:53 -06:00
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o /ldapd . && \
apk add upx binutils && \
strip /ldapd && \
upx /ldapd && \
ls -alh /ldapd
2020-11-09 20:27:44 -06:00
FROM scratch
2020-11-11 00:05:02 -06:00
LABEL org.opencontainers.image.source https://github.com/netauth/ldap
2020-11-09 20:27:44 -06:00
ENTRYPOINT ["/ldapd"]
COPY --from=build /ldapd /ldapd