From 02e3586296e2382b31934d930175c80874287154 Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:13:04 -0400 Subject: [PATCH] Add `-mod=readonly` for Konflux Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> --- build/Dockerfile.rhtap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dockerfile.rhtap b/build/Dockerfile.rhtap index 4886188c..19c54919 100644 --- a/build/Dockerfile.rhtap +++ b/build/Dockerfile.rhtap @@ -20,7 +20,7 @@ COPY controllers/ controllers/ COPY pkg/ pkg/ # Build -RUN CGO_ENABLED=1 GOOS=${GOOS} GOARCH=${GOARCH} go build -a -ldflags "${LDFLAGS}" -o manager main.go +RUN CGO_ENABLED=1 GOOS=${GOOS} GOARCH=${GOARCH} go build -mod=readonly -a -ldflags "${LDFLAGS}" -o manager main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details