Skip to content

Commit 05b8ce0

Browse files
smtan-glcx-rui-araujocx-artur-ribeiro
authored
fix: Restore CGO_ENABLED=0 for static linking in Dockerfile (#7397)
This reverts part of commit 42272a2 which removed CGO_ENABLED=0. The flag is necessary to ensure all dependencies are statically linked during the build process, preventing runtime dependencies on host system C libraries. Co-authored-by: Rui Araújo Gomes <rui.araujo@checkmarx.com> Co-authored-by: Artur Ribeiro <artur.ribeiro@checkmarx.com>
1 parent 810b4c9 commit 05b8ce0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN go mod download -x
2121
COPY . .
2222

2323
# Build the Go app
24-
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
24+
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
2525
-ldflags "-s -w -X github.com/Checkmarx/kics/v2/internal/constants.Version=${VERSION} -X github.com/Checkmarx/kics/v2/internal/constants.SCMCommit=${COMMIT} -X github.com/Checkmarx/kics/v2/internal/constants.SentryDSN=${SENTRY_DSN} -X github.com/Checkmarx/kics/v2/internal/constants.BaseURL=${DESCRIPTIONS_URL}" \
2626
-a -installsuffix cgo \
2727
-o bin/kics cmd/console/main.go

0 commit comments

Comments
 (0)