diff --git a/k8s-mpam-controller/Makefile b/k8s-mpam-controller/Makefile index 6193c490979e31a6f3658964a4e4c5bd291dc88b..2a8489912dfffefe79e7cd6f6b1d384152a821f3 100644 --- a/k8s-mpam-controller/Makefile +++ b/k8s-mpam-controller/Makefile @@ -1,6 +1,6 @@ all: -# go get -d -v ./... - go install -ldflags "-s -w" ./cmd/* + go get -d -v ./... + CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2" go install -buildmode=pie -ldflags "-s -linkmode 'external' -extldflags '-Wl,-z,now'" ./cmd/* # To build in docker envrionment you can run following cmd directly docker: diff --git a/k8s-mpam-controller/build.sh b/k8s-mpam-controller/build.sh index c2f79097f97ab7c9d415bf29618be8f391507f1f..6a292b83f8cc88bd5ccd5f967c42506b40d0f22e 100755 --- a/k8s-mpam-controller/build.sh +++ b/k8s-mpam-controller/build.sh @@ -1,2 +1,2 @@ go get -d -v ./... -go install -ldflags "-s -w" ./cmd/* +CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2" go install -buildmode=pie -ldflags "-s -linkmode 'external' -extldflags '-Wl,-z,now'" ./cmd/*