1313 runs-on : ubuntu-latest
1414 strategy :
1515 matrix :
16- include :
16+ platform : [linux/amd64, linux/arm64]
17+ variant :
1718 - type : " "
1819 suffix : " "
1920 - type : " -alpine"
@@ -25,11 +26,19 @@ jobs:
2526 uses : docker/setup-qemu-action@v3
2627 - name : Set up Docker Buildx
2728 uses : docker/setup-buildx-action@v3
29+ with :
30+ buildkitd-flags : --debug
31+ - name : Cache Docker layers
32+ uses : actions/cache@v4
33+ with :
34+ path : /tmp/.buildx-cache
35+ key : ${{ runner.os }}-buildx-${{ matrix.platform }}-${{ matrix.variant.type }}-${{ github.sha }}
36+ restore-keys : |
37+ ${{ runner.os }}-buildx-${{ matrix.platform }}-${{ matrix.variant.type }}-
2838
2939 - name : Prepare Docker build
3040 id : prepare
3141 run : |
32- PLATFORMS="linux/amd64,linux/arm64"
3342 REPO="bitcoin/bitcoin"
3443 BRANCH="master"
3544 PUSH="false"
@@ -38,10 +47,10 @@ jobs:
3847 fi
3948
4049 echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" | tee -a $GITHUB_OUTPUT
41- echo "docker_platforms=${PLATFORMS }" | tee -a $GITHUB_OUTPUT
50+ echo "docker_platforms=${{ matrix.platform } }" | tee -a $GITHUB_OUTPUT
4251 echo "docker_username=bitcoin" | tee -a $GITHUB_OUTPUT
4352 echo "push=${PUSH}" | tee -a $GITHUB_OUTPUT
44- echo "tags=${REPO}:nightly${{ matrix.type }}" | tee -a $GITHUB_OUTPUT
53+ echo "tags=${REPO}:nightly${{ matrix.variant. type }}" | tee -a $GITHUB_OUTPUT
4554
4655 - name : Login into Docker Hub
4756 uses : docker/login-action@v3
6675 docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
6776 --output "type=image,push=${{ steps.prepare.outputs.push }}" \
6877 --progress=plain \
78+ --cache-from "type=local,src=/tmp/.buildx-cache" \
79+ --cache-to "type=local,dest=/tmp/.buildx-cache-new,mode=max" \
6980 --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
7081 --build-arg "VCS_REF=${GITHUB_SHA::8}" \
7182 $(printf "%s" "${TAGS[@]/#/ --tag }" ) \
72- master${{ matrix.suffix }}
83+ master${{ matrix.variant.suffix }}
84+
85+ # Temp fix
86+ # https://github.com/docker/build-push-action/issues/252
87+ # https://github.com/moby/buildkit/issues/1896
88+ rm -rf /tmp/.buildx-cache
89+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
0 commit comments