Skip to content

Commit 1ffb16e

Browse files
committed
build: try a manual docker build for arm64 variant 8
1 parent 1f763c3 commit 1ffb16e

File tree

1 file changed

+37
-25
lines changed

1 file changed

+37
-25
lines changed

.github/workflows/main.yml

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
runs-on: ${{ matrix.os }}
3737
permissions:
3838
packages: write
39+
env:
40+
PLATFORMS: 'linux/amd64 linux/arm64/v8'
3941

4042
steps:
4143
-
@@ -137,32 +139,42 @@ jobs:
137139
registry: 'docker.io'
138140
username: ${{ github.repository_owner }}
139141
password: ${{ secrets.DOCKERHUB_TOKEN }}
140-
141142
-
142-
name: Upload Buildroot
143-
uses: docker/build-push-action@v6
144-
with:
145-
push: true
146-
provenance: false
147-
platforms: |
148-
linux/amd64
149-
linux/arm64/v8
150-
context: "."
151-
file: Dockerfile.alpine
152-
target: buildroot
153-
cache-to: |
154-
type=gha
155-
cache-from: |
156-
type=gha
157-
type=registry,ref=${{ steps.image_env.outputs.IMAGE_TAG }}-buildroot
158-
type=registry,ref=${{ steps.image_env.outputs.SOURCE_IMAGE }}@${{ steps.image_env.outputs.BASE_IMAGE_DIGEST }}
159-
build-args: |
160-
ALPINE_VERSION=${{ steps.image_env.outputs.ALPINE_VERSION }}
161-
BASE_IMAGE_DIGEST=${{ steps.image_env.outputs.BASE_IMAGE_DIGEST }}
162-
PYTHON_VERSION=${{ steps.image_env.outputs.PYTHON_VERSION }}
163-
SOURCE_IMAGE=${{ steps.image_env.outputs.SOURCE_IMAGE }}
164-
BUILD_ROOT=/d
165-
tags: "${{ steps.image_env.outputs.IMAGE_TAG }}-buildroot"
143+
env:
144+
IMAGE_URI: ${{ steps.image_env.outputs.IMAGE_TAG }}-buildroot
145+
run: |
146+
for platform in $PLATFORMS
147+
do
148+
docker build --platform "$platform" --push --cache-to type=gha --cache-from type=gha --build-arg 'ALPINE_VERSION=${{ steps.image_env.outputs.ALPINE_VERSION }}' --build-arg 'BASE_IMAGE_DIGEST=${{ steps.image_env.outputs.BASE_IMAGE_DIGEST }}' --build-arg 'PYTHON_VERSION=${{ steps.image_env.outputs.PYTHON_VERSION }}' --build-arg 'SOURCE_IMAGE=${{ steps.image_env.outputs.SOURCE_IMAGE }}' --build-arg 'BUILD_ROOT=/d' --tag "${IMAGE_URI}-$(echo "${platform}" | tr '/' '-' )" -f Dockerfile.alpine .
149+
echo "${IMAGE_URI}-$(echo "${platform}" | tr '/' '-' )" | tee -a $IMAGE_HOME/images.txt
150+
done
151+
docker manifest create "${IMAGE_URI}" $(cat $IMAGE_HOME/images.txt)
152+
docker manifest push "${IMAGE_URI}"
153+
# -
154+
# name: Upload Buildroot
155+
# uses: docker/build-push-action@v6
156+
# with:
157+
# push: true
158+
# provenance: false
159+
# platforms: |
160+
# linux/amd64
161+
# linux/arm64/v8
162+
# context: "."
163+
# file: Dockerfile.alpine
164+
# target: buildroot
165+
# cache-to: |
166+
# type=gha
167+
# cache-from: |
168+
# type=gha
169+
# type=registry,ref=${{ steps.image_env.outputs.IMAGE_TAG }}-buildroot
170+
# type=registry,ref=${{ steps.image_env.outputs.SOURCE_IMAGE }}@${{ steps.image_env.outputs.BASE_IMAGE_DIGEST }}
171+
# build-args: |
172+
# ALPINE_VERSION=${{ steps.image_env.outputs.ALPINE_VERSION }}
173+
# BASE_IMAGE_DIGEST=${{ steps.image_env.outputs.BASE_IMAGE_DIGEST }}
174+
# PYTHON_VERSION=${{ steps.image_env.outputs.PYTHON_VERSION }}
175+
# SOURCE_IMAGE=${{ steps.image_env.outputs.SOURCE_IMAGE }}
176+
# BUILD_ROOT=/d
177+
# tags: "${{ steps.image_env.outputs.IMAGE_TAG }}-buildroot"
166178
-
167179
name: Upload
168180
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)