Turn off the CGO to make it static linked

This commit is contained in:
gzzchh
2020-11-08 14:42:55 +08:00
parent 4b17ac4f1c
commit 33e584b447
3 changed files with 6 additions and 5 deletions

View File

@@ -6,8 +6,8 @@ FROM golang:1.15-alpine
COPY . /go/wings/
WORKDIR /go/wings/
RUN apk add --no-cache upx \
&& go build -ldflags="-s -w" \
&& upx --brute wings
&& CGO_ENABLED=0 go build -ldflags="-s -w" \
&& upx --brute wings
FROM alpine:latest
COPY --from=0 /go/wings/wings /usr/bin/