Shrink docker container
This commit is contained in:
parent
9d283c5315
commit
12c4054bce
|
@ -1,8 +1,12 @@
|
||||||
FROM golang:1.15 as build
|
FROM golang:1.15-alpine as build
|
||||||
WORKDIR /netauth/ldap
|
WORKDIR /netauth/ldap
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go mod vendor && \
|
RUN go mod vendor && \
|
||||||
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o /ldapd .
|
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o /ldapd . && \
|
||||||
|
apk add upx binutils && \
|
||||||
|
strip /ldapd && \
|
||||||
|
upx /ldapd && \
|
||||||
|
ls -alh /ldapd
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
LABEL org.opencontainers.image.source https://github.com/netauth/ldap
|
LABEL org.opencontainers.image.source https://github.com/netauth/ldap
|
||||||
|
|
Loading…
Reference in a new issue