From a9381413ca414f7280641249a50f6aa97d0ab5f5 Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Sat, 30 Mar 2024 14:42:26 +0000 Subject: [PATCH 1/8] use arm64 supported curlimages/curl instead of busyboxplus:curl --- Dockerfile.starter | 4 ++++ working_arm64 | 1 + 2 files changed, 5 insertions(+) create mode 160000 working_arm64 diff --git a/Dockerfile.starter b/Dockerfile.starter index d320b507..4dd3053b 100644 --- a/Dockerfile.starter +++ b/Dockerfile.starter @@ -3,3 +3,7 @@ FROM radial/busyboxplus:curl # as defined by distroless for nonroot USER 65532:65532 COPY --from=redboxoss/scuttle:latest /scuttle /bin/scuttle + +FROM curlimages/curl:latest + +COPY --from=kvij/scuttle:latest /scuttle /bin/scuttle diff --git a/working_arm64 b/working_arm64 new file mode 160000 index 00000000..d1308d76 --- /dev/null +++ b/working_arm64 @@ -0,0 +1 @@ +Subproject commit d1308d76085e08212e4e2ebcd256091b436369bb From 01161ebc48969aeab000bbf94cac8d0e34433eb2 Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Sat, 30 Mar 2024 14:46:15 +0000 Subject: [PATCH 2/8] use arm64 supported kvij/scuttle instead of redboxoss/scuttle https://github.com/redboxllc/scuttle/pull/60#issuecomment-1342925256 --- Dockerfile.runner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.runner b/Dockerfile.runner index c8e6e186..2a2d8606 100644 --- a/Dockerfile.runner +++ b/Dockerfile.runner @@ -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"] From 3414dee8a0710bd894af953f0b45623bc3025f46 Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Sat, 30 Mar 2024 14:48:20 +0000 Subject: [PATCH 3/8] remove explicit GOARCH=amd64 --- Dockerfile.controller | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.controller b/Dockerfile.controller index abd72b34..62a15d5c 100644 --- a/Dockerfile.controller +++ b/Dockerfile.controller @@ -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 From 40508df6cfe2d6ea3b04504716dcff7977ea4b96 Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Sat, 30 Mar 2024 15:40:25 +0000 Subject: [PATCH 4/8] build arm64 image with qemu, update workflow versions in push.yml --- .github/workflows/push.yaml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 1a6611f4..de2da679 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -5,7 +5,7 @@ on: workflow_dispatch: inputs: image_tag: - description: 'Image tag name.' + description: "Image tag name." required: true release: types: @@ -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 @@ -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 + version: v0.12.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: @@ -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 From 4cfb17ef1ff19d48f61394a4a493260e51a080fc Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Sat, 30 Mar 2024 15:59:27 +0000 Subject: [PATCH 5/8] revert pushing worktree for branch working_arm64 by mistake --- working_arm64 | 1 - 1 file changed, 1 deletion(-) delete mode 160000 working_arm64 diff --git a/working_arm64 b/working_arm64 deleted file mode 160000 index d1308d76..00000000 --- a/working_arm64 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d1308d76085e08212e4e2ebcd256091b436369bb From 0207cc50fb86cd312546029143e65bec10e6cc2c Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Sat, 30 Mar 2024 16:03:05 +0000 Subject: [PATCH 6/8] fix starter dockerfile --- Dockerfile.starter | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Dockerfile.starter b/Dockerfile.starter index 4dd3053b..a7fa4b67 100644 --- a/Dockerfile.starter +++ b/Dockerfile.starter @@ -1,9 +1,3 @@ -FROM radial/busyboxplus:curl - -# as defined by distroless for nonroot -USER 65532:65532 -COPY --from=redboxoss/scuttle:latest /scuttle /bin/scuttle - FROM curlimages/curl:latest COPY --from=kvij/scuttle:latest /scuttle /bin/scuttle From 3c92673eaa6da023e056be4b893b016a8257dcde Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Sun, 31 Mar 2024 20:22:11 +0000 Subject: [PATCH 7/8] revert to buildx version 0.9.1 --- .github/workflows/push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index de2da679..f958e4bd 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -33,7 +33,7 @@ jobs: - name: "Build:buildx" uses: docker/setup-buildx-action@v3 with: - version: v0.12.1 # Buildx version + version: v0.9.1 # Buildx version - name: "Build:login" uses: docker/login-action@v3 with: From 4f36776ad7236e52da8b1c7e5fb4a184f391ed46 Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Sun, 31 Mar 2024 20:25:16 +0000 Subject: [PATCH 8/8] keep USER 65532:65532 --- Dockerfile.starter | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.starter b/Dockerfile.starter index a7fa4b67..88e523d8 100644 --- a/Dockerfile.starter +++ b/Dockerfile.starter @@ -1,3 +1,5 @@ FROM curlimages/curl:latest +# as defined by distroless for nonroot +USER 65532:65532 COPY --from=kvij/scuttle:latest /scuttle /bin/scuttle