Skip to content

Commit

Permalink
Fix docker multiarch build for operator (#882)
Browse files Browse the repository at this point in the history
* Fix docker multiarch build for operator

Signed-off-by: Pavol Loffay <[email protected]>

* Fix docker multiarch build for operator

Signed-off-by: Pavol Loffay <[email protected]>

* Fix multiarch build for TA

Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored May 24, 2022
1 parent 4ffcef4 commit 58a8e79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions cmd/otel-allocator/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 58a8e79

Please sign in to comment.