Skip to content

Commit

Permalink
build platform
Browse files Browse the repository at this point in the history
  • Loading branch information
kebe7jun committed Aug 16, 2024
1 parent 0fce66c commit 8993155
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docker/agent.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# builder
FROM m.daocloud.io/docker.io/golang:1.22.2 as builder
FROM --platform=$BUILDPLATFORM m.daocloud.io/docker.io/golang:1.22.2 as builder

WORKDIR /app

Expand All @@ -12,7 +11,9 @@ RUN go mod download

ADD . .

RUN go build -ldflags "-s -w" -o kcover-agent ./cmd/collector-controller
ARG TARGETARCH

RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -ldflags "-s -w" -o kcover-agent ./cmd/collector-controller

# runner
FROM m.daocloud.io/docker.io/ubuntu:22.04
Expand Down
5 changes: 3 additions & 2 deletions docker/controller.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# builder
FROM m.daocloud.io/docker.io/golang:1.22.2 as builder
FROM --platform=$BUILDPLATFORM m.daocloud.io/docker.io/golang:1.22.2 as builder

WORKDIR /app

Expand All @@ -12,7 +12,8 @@ RUN go mod download

ADD . .

RUN go build -ldflags "-s -w" -o kcover-controller ./cmd/kcover
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -ldflags "-s -w" -o kcover-controller ./cmd/kcover

# runner
FROM m.daocloud.io/docker.io/ubuntu:22.04
Expand Down

0 comments on commit 8993155

Please sign in to comment.