diff --git a/Dockerfile b/Dockerfile index 501565fefc..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 @@ -28,7 +27,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 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