From 25e9613594f167580dd03f1b17fa82c91f632caa Mon Sep 17 00:00:00 2001 From: Rudra Date: Wed, 4 Mar 2026 22:23:30 +0530 Subject: [PATCH] fix(cli): enable multi-arch docker builds for sandbox (#19821) Co-authored-by: Tommaso Sciortino --- .github/actions/push-sandbox/action.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/actions/push-sandbox/action.yml b/.github/actions/push-sandbox/action.yml index e2d1ac942c..bab85af453 100644 --- a/.github/actions/push-sandbox/action.yml +++ b/.github/actions/push-sandbox/action.yml @@ -44,6 +44,8 @@ runs: - name: 'npm build' shell: 'bash' run: 'npm run build' + - name: 'Set up QEMU' + uses: 'docker/setup-qemu-action@v3' - name: 'Set up Docker Buildx' uses: 'docker/setup-buildx-action@v3' - name: 'Log in to GitHub Container Registry' @@ -69,16 +71,19 @@ runs: env: INPUTS_GITHUB_REF_NAME: '${{ inputs.github-ref-name }}' INPUTS_GITHUB_SHA: '${{ inputs.github-sha }}' + # We build amd64 just so we can verify it. + # We build and push both amd64 and arm64 in the publish step. - name: 'build' id: 'docker_build' shell: 'bash' env: GEMINI_SANDBOX_IMAGE_TAG: '${{ steps.image_tag.outputs.FINAL_TAG }}' GEMINI_SANDBOX: 'docker' + BUILD_SANDBOX_FLAGS: '--platform linux/amd64 --load' STEPS_IMAGE_TAG_OUTPUTS_FINAL_TAG: '${{ steps.image_tag.outputs.FINAL_TAG }}' run: |- npm run build:sandbox -- \ - --image google/gemini-cli-sandbox:${STEPS_IMAGE_TAG_OUTPUTS_FINAL_TAG} \ + --image "google/gemini-cli-sandbox:${STEPS_IMAGE_TAG_OUTPUTS_FINAL_TAG}" \ --output-file final_image_uri.txt echo "uri=$(cat final_image_uri.txt)" >> $GITHUB_OUTPUT - name: 'verify' @@ -92,10 +97,14 @@ runs: - name: 'publish' shell: 'bash' if: "${{ inputs.dry-run != 'true' }}" - run: |- - docker push "${STEPS_DOCKER_BUILD_OUTPUTS_URI}" env: - STEPS_DOCKER_BUILD_OUTPUTS_URI: '${{ steps.docker_build.outputs.uri }}' + GEMINI_SANDBOX_IMAGE_TAG: '${{ steps.image_tag.outputs.FINAL_TAG }}' + GEMINI_SANDBOX: 'docker' + BUILD_SANDBOX_FLAGS: '--platform linux/amd64,linux/arm64 --push' + STEPS_IMAGE_TAG_OUTPUTS_FINAL_TAG: '${{ steps.image_tag.outputs.FINAL_TAG }}' + run: |- + npm run build:sandbox -- \ + --image "google/gemini-cli-sandbox:${STEPS_IMAGE_TAG_OUTPUTS_FINAL_TAG}" - name: 'Create issue on failure' if: |- ${{ failure() }}