From cf98a9702dba4450efcd86bcf73bdf1cff6297da Mon Sep 17 00:00:00 2001 From: Sophia Castellarin Date: Wed, 29 Jan 2025 15:07:09 -0800 Subject: [PATCH] Build and push docker images for multiple platforms in one step (#1067) Co-authored-by: Peyton Murray --- .github/workflows/build_docker_image.yaml | 15 +++++++++++---- .github/workflows/release.yaml | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_docker_image.yaml b/.github/workflows/build_docker_image.yaml index 36776a0ec..91c929fe3 100644 --- a/.github/workflows/build_docker_image.yaml +++ b/.github/workflows/build_docker_image.yaml @@ -21,9 +21,6 @@ jobs: docker-image: - conda-store - conda-store-server - platform: - - linux/amd64 - - linux/arm64 steps: - name: "Checkout Repository 🛎" uses: actions/checkout@v4 @@ -47,6 +44,16 @@ jobs: - name: "Set up Docker Buildx 🏗" uses: docker/setup-buildx-action@v3 + # Required for building multi-platform images. See + # https://docs.docker.com/build/ci/github-actions/multi-platform/#build-and-load-multi-platform-images + with: + daemon-config: | + { + "debug": true, + "features": { + "containerd-snapshotter": true + } + } - name: "Login to Docker Hub 🐳" uses: docker/login-action@v3 @@ -92,4 +99,4 @@ jobs: cache-to: type=gha,mode=max build-args: | python_version=${{ env.PYTHON_VERSION_DEFAULT }} - platforms: ${{ matrix.platform }} + platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4b8e25c7d..8fc97b872 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -119,9 +119,6 @@ jobs: docker-image: - conda-store - conda-store-server - platform: - - linux/amd64 - - linux/arm64 steps: - name: "Checkout Repository 🛎" uses: actions/checkout@v4 @@ -150,6 +147,16 @@ jobs: - name: "Set up Docker Buildx 🏗" uses: docker/setup-buildx-action@v3 + # Required for building multi-platform images. See + # https://docs.docker.com/build/ci/github-actions/multi-platform/#build-and-load-multi-platform-images + with: + daemon-config: | + { + "debug": true, + "features": { + "containerd-snapshotter": true + } + } - name: "Login to Docker Hub 🐳" uses: docker/login-action@v3 @@ -191,5 +198,5 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - platforms: ${{ matrix.platform }} + platforms: linux/amd64,linux/arm64 if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')