From 3c3b78526e5bdba449ab9414a2f4faafaae50198 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Thu, 19 May 2022 13:03:00 +0200 Subject: [PATCH 1/3] Fix docker multiarch build for operator Signed-off-by: Pavol Loffay --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 501565fefc..5a33337101 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ ARG AUTO_INSTRUMENTATION_NODEJS_VERSION ARG AUTO_INSTRUMENTATION_PYTHON_VERSION # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -ldflags="-X ${VERSION_PKG}.version=${VERSION} -X ${VERSION_PKG}.buildDate=${VERSION_DATE} -X ${VERSION_PKG}.otelCol=${OTELCOL_VERSION} -X ${VERSION_PKG}.targetAllocator=${TARGETALLOCATOR_VERSION} -X ${VERSION_PKG}.autoInstrumentationJava=${AUTO_INSTRUMENTATION_JAVA_VERSION} -X ${VERSION_PKG}.autoInstrumentationNodeJS=${AUTO_INSTRUMENTATION_NODEJS_VERSION} -X ${VERSION_PKG}.autoInstrumentationPython=${AUTO_INSTRUMENTATION_PYTHON_VERSION}" -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -ldflags="-X ${VERSION_PKG}.version=${VERSION} -X ${VERSION_PKG}.buildDate=${VERSION_DATE} -X ${VERSION_PKG}.otelCol=${OTELCOL_VERSION} -X ${VERSION_PKG}.targetAllocator=${TARGETALLOCATOR_VERSION} -X ${VERSION_PKG}.autoInstrumentationJava=${AUTO_INSTRUMENTATION_JAVA_VERSION} -X ${VERSION_PKG}.autoInstrumentationNodeJS=${AUTO_INSTRUMENTATION_NODEJS_VERSION} -X ${VERSION_PKG}.autoInstrumentationPython=${AUTO_INSTRUMENTATION_PYTHON_VERSION}" -a -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 From 5b67410c3a10649ea58d5de227a6aeb8f34676e3 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Thu, 19 May 2022 13:18:38 +0200 Subject: [PATCH 2/3] Fix docker multiarch build for operator Signed-off-by: Pavol Loffay --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5a33337101..a38643660e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,6 @@ COPY internal/ internal/ COPY pkg/ pkg/ COPY versions.txt versions.txt -ARG TARGETARCH=amd64 ARG VERSION_PKG ARG VERSION ARG VERSION_DATE From 26f2f07af8f3ab1e929de4d317f81a31d108990e Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Mon, 23 May 2022 11:19:42 +0200 Subject: [PATCH 3/3] Fix multiarch build for TA Signed-off-by: Pavol Loffay --- cmd/otel-allocator/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/otel-allocator/Dockerfile b/cmd/otel-allocator/Dockerfile index 3179bf22c5..6f88d650a5 100644 --- a/cmd/otel-allocator/Dockerfile +++ b/cmd/otel-allocator/Dockerfile @@ -1,8 +1,6 @@ # Build the target allocator binary FROM golang:1.18 as builder -ARG TARGETARCH=amd64 - WORKDIR /app # Copy go mod and sum files @@ -13,7 +11,7 @@ RUN go mod download COPY . . # Build the Go app -RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -installsuffix cgo -o main . +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . ######## Start a new stage from scratch ####### FROM alpine:latest