From 5198e2636a45bace53559e1e8d92bc1bb1c31b95 Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Thu, 9 Apr 2026 15:24:45 +0200 Subject: [PATCH] Fix local building of roxie container image Without this fix, locally invoking `make docker-build` fails due to ``` [...] [1/2] STEP 11/15: RUN echo "Building for ${TARGETOS}/${TARGETARCH}" && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags "-w -s -X main.version=${VERSION} -X main.gitCommit=${GIT_COMMIT} -X main.buildDate=${BUILD_DATE}" -o roxie ./cmd Building for linux/arm64 github.com/stackrox/roxie/cmd: go build github.com/stackrox/roxie/cmd: copying /tmp/go-build3080175455/b001/exe/a.out: open roxie: permission denied Error: building at STEP "RUN echo "Building for ${TARGETOS}/${TARGETARCH}" && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags "-w -s -X main.version=${VERSION} -X main.gitCommit=${GIT_COMMIT} -X main.buildDate=${BUILD_DATE}" -o roxie ./cmd": while running runtime: exit status 1 make: *** [Makefile:190: docker-build] Error 1 ``` --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 91fa54dd..a295b277 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ ARG TARGETOS ARG TARGETARCH WORKDIR /build +USER root # Copy go mod files first for better layer caching COPY go.mod go.sum ./ @@ -33,7 +34,7 @@ RUN echo "Building for ${TARGETOS}/${TARGETARCH}" && \ # Latest version including checksums can be found at: # https://docs.cloud.google.com/sdk/docs/install-sdk#linux # -# Unfortunately Googles release pipelines currently do not properly support versioned, checksum-protected downloads, +# Unfortunately Googles release pipelines currently do not properly support versioned, checksum-protected downloads, # # THE PROBLEM #