File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ before:
18
18
builds :
19
19
- env :
20
20
- CGO_ENABLED=0
21
- ldflags : -s -X github.com/ketches/kube-recycle-bin/cmd/krb-cli/cmd.Version={{.Version}}
21
+ ldflags : -s -w - X github.com/ketches/kube-recycle-bin/cmd/krb-cli/cmd.Version={{.Version}}
22
22
main : ./cmd/krb-cli
23
23
goos :
24
24
- linux
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ COPY cmd/${KRB_APPNAME} ./cmd/${KRB_APPNAME}
11
11
COPY pkg/ ./pkg/
12
12
COPY internal/ ./internal/
13
13
14
- RUN CGO_ENABLED=0 GOOS=linux go build -o ./bin/${KRB_APPNAME} ./cmd/${KRB_APPNAME}
14
+ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags= "-s -w" - o ./bin/${KRB_APPNAME} ./cmd/${KRB_APPNAME}
15
15
16
16
FROM alpine:latest
17
17
ARG KRB_APPNAME
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ ALIYUN_REGISTRY := registry.cn-hangzhou.aliyuncs.com/ketches
5
5
.PHONY : install
6
6
install :
7
7
@echo " » installing krb-cli..."
8
- go install -ldflags=" -X github.com/ketches/kube-recycle-bin/cmd/krb-cli/cmd.Version=${KRB_VERSION} " ./cmd/krb-cli
8
+ go install -ldflags=" -s -w - X github.com/ketches/kube-recycle-bin/cmd/krb-cli/cmd.Version=${KRB_VERSION} " ./cmd/krb-cli
9
9
10
10
.PHONY : build
11
11
build : build-binary build-binary build-docker
@@ -14,13 +14,13 @@ build-binary: build-controller-binary build-webhook-binary
14
14
15
15
build-controller-binary :
16
16
@echo " » building krb binary..."
17
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/amd64/krb-controller cmd/krb-controller/main.go
18
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/arm64/krb-controller cmd/krb-controller/main.go
17
+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags= " -s -w " - o bin/amd64/krb-controller cmd/krb-controller/main.go
18
+ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags= " -s -w " - o bin/arm64/krb-controller cmd/krb-controller/main.go
19
19
20
20
build-webhook-binary :
21
21
@echo " » building krb binary..."
22
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/amd64/krb-webhook cmd/krb-webhook/main.go
23
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/arm64/krb-webhook cmd/krb-webhook/main.go
22
+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags= " -s -w " - o bin/amd64/krb-webhook cmd/krb-webhook/main.go
23
+ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags= " -s -w " - o bin/arm64/krb-webhook cmd/krb-webhook/main.go
24
24
25
25
docker-buildx-init :
26
26
@echo " » initializing docker buildx..."
You can’t perform that action at this time.
0 commit comments