Skip to content

Commit

Permalink
ci: Fix multi-platform build (#134)
Browse files Browse the repository at this point in the history
* ci: Fix multi-platform build

* update

* update
  • Loading branch information
peimanja committed Feb 20, 2024
1 parent fcb76b4 commit 8dfb2ca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21 as build
FROM golang:1.21 AS build

WORKDIR /go/artifactory_exporter
ADD . /go/artifactory_exporter
Expand All @@ -13,7 +13,10 @@ ARG SOURCE_BRANCH
ARG BUILD_DATE
ARG BUILD_USER

RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o /go/bin/artifactory_exporter -ldflags " \

ARG TARGETPLATFORM

RUN CGO_ENABLED=0 GOOS=linux GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) go build -a -o /go/bin/artifactory_exporter -ldflags " \
-X github.com/prometheus/common/version.Version=${VERSION} \
-X github.com/prometheus/common/version.Revision=${SOURCE_COMMIT} \
-X github.com/prometheus/common/version.Branch=${SOURCE_BRANCH} \
Expand Down

0 comments on commit 8dfb2ca

Please sign in to comment.