Skip to content

Commit b0160e4

Browse files
committed
Update ci
1 parent 56f1e64 commit b0160e4

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/build-and-push.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ jobs:
6060
type=sha,prefix={{branch}}-
6161
type=raw,value=latest,enable={{is_default_branch}}
6262
63-
- name: Build and push Docker image
63+
- name: Build and push Docker image (multi-arch amd64, arm64)
6464
uses: docker/build-push-action@v5
6565
with:
6666
context: .
6767
file: ./Dockerfile
68+
platforms: linux/amd64,linux/arm64
6869
build-args: |
6970
VERSION=${{ steps.version.outputs.version }}
7071
push: true
@@ -115,7 +116,7 @@ jobs:
115116
116117
## Docker Image
117118
118-
Docker image is available at:
119+
Docker image is available at (multi-arch: amd64, arm64):
119120
```
120121
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG_NAME }}
121122
```

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ COPY . .
1818

1919
# Версия оператора для дефолтного образа процессора (тот же тег при сборке из релиза).
2020
ARG VERSION=dev
21+
# Multi-arch: при docker buildx --platform передаётся TARGETARCH (amd64, arm64).
22+
ARG TARGETARCH=amd64
2123
# Build manager (operator)
22-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager \
24+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -a -o manager \
2325
-ldflags "-X github.com/dataflow-operator/dataflow/internal/version.Version=${VERSION}" \
2426
main.go
2527

2628
# Build processor
27-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o processor cmd/processor/main.go
29+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -a -o processor cmd/processor/main.go
2830

2931
# Build GUI server
30-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o gui-server cmd/gui-server/main.go
32+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -a -o gui-server cmd/gui-server/main.go
3133

3234
# Final stage
3335
FROM alpine:latest

0 commit comments

Comments
 (0)