Skip to content

Commit

Permalink
Add arm64 support (#380)
Browse files Browse the repository at this point in the history
* use arm64 supported curlimages/curl instead of busyboxplus:curl

* use arm64 supported kvij/scuttle instead of redboxoss/scuttle redboxllc/scuttle#60 (comment)

* remove  explicit GOARCH=amd64

* build arm64 image with qemu, update workflow versions in push.yml

* revert pushing worktree for branch working_arm64 by mistake

* fix starter dockerfile

* revert to buildx version 0.9.1

* keep USER 65532:65532
  • Loading branch information
audacioustux authored Apr 1, 2024
1 parent 55d949e commit 1441c17
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
inputs:
image_tag:
description: 'Image tag name.'
description: "Image tag name."
required: true
release:
types:
Expand All @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Build:checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Set image tag name"
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
Expand All @@ -28,38 +28,43 @@ jobs:
- name: "Check image tag name"
run: |
echo "IMAGETAG=${{env.IMAGETAG}}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: "Build:buildx"
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
with:
version: v0.9.1 # Buildx version
- name: "Build:login"
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Build:dockerimage"
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
file: Dockerfile.controller
build-args: |
GO_BUILDER_IMG=golang:1.19
platforms: linux/amd64,linux/arm64
tags: ghcr.io/grafana/k6-operator:latest,ghcr.io/grafana/k6-operator:controller-${{env.IMAGETAG}}
- name: "Build:dockerimage"
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
file: Dockerfile.runner
platforms: linux/amd64,linux/arm64
tags: ghcr.io/grafana/k6-operator:latest-runner,ghcr.io/grafana/k6-operator:runner-${{env.IMAGETAG}}
- name: "Build:dockerimage"
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
file: Dockerfile.starter
platforms: linux/amd64,linux/arm64
tags: ghcr.io/grafana/k6-operator:latest-starter,ghcr.io/grafana/k6-operator:starter-${{env.IMAGETAG}}

bundle:
Expand All @@ -70,7 +75,7 @@ jobs:
pull-requests: write
steps:
- name: "Checkout code"
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Set image tag name"
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.controller
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COPY pkg/ pkg/


# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -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
2 changes: 1 addition & 1 deletion Dockerfile.runner
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM grafana/k6:latest

COPY --from=redboxoss/scuttle:latest scuttle /bin/scuttle
COPY --from=kvij/scuttle:latest scuttle /bin/scuttle
ENTRYPOINT ["scuttle", "k6"]
4 changes: 2 additions & 2 deletions Dockerfile.starter
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM radial/busyboxplus:curl
FROM curlimages/curl:latest

# as defined by distroless for nonroot
USER 65532:65532
COPY --from=redboxoss/scuttle:latest /scuttle /bin/scuttle
COPY --from=kvij/scuttle:latest /scuttle /bin/scuttle

0 comments on commit 1441c17

Please sign in to comment.