Skip to content

Commit bc97925

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

File tree

1 file changed

+38
-25
lines changed

1 file changed

+38
-25
lines changed

.github/workflows/main.yml

Lines changed: 38 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,43 @@ 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+
IMAGE_HOME: ${{ steps.image_env.outputs.IMAGE_HOME }}
146+
run: |
147+
for platform in $PLATFORMS
148+
do
149+
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 .
150+
echo "${IMAGE_URI}-$(echo "${platform}" | tr '/' '-' )" | tee -a $IMAGE_HOME/images.txt
151+
done
152+
docker manifest create "${IMAGE_URI}" $(cat $IMAGE_HOME/images.txt)
153+
docker manifest push "${IMAGE_URI}"
154+
# -
155+
# name: Upload Buildroot
156+
# uses: docker/build-push-action@v6
157+
# with:
158+
# push: true
159+
# provenance: false
160+
# platforms: |
161+
# linux/amd64
162+
# linux/arm64/v8
163+
# context: "."
164+
# file: Dockerfile.alpine
165+
# target: buildroot
166+
# cache-to: |
167+
# type=gha
168+
# cache-from: |
169+
# type=gha
170+
# type=registry,ref=${{ steps.image_env.outputs.IMAGE_TAG }}-buildroot
171+
# type=registry,ref=${{ steps.image_env.outputs.SOURCE_IMAGE }}@${{ steps.image_env.outputs.BASE_IMAGE_DIGEST }}
172+
# build-args: |
173+
# ALPINE_VERSION=${{ steps.image_env.outputs.ALPINE_VERSION }}
174+
# BASE_IMAGE_DIGEST=${{ steps.image_env.outputs.BASE_IMAGE_DIGEST }}
175+
# PYTHON_VERSION=${{ steps.image_env.outputs.PYTHON_VERSION }}
176+
# SOURCE_IMAGE=${{ steps.image_env.outputs.SOURCE_IMAGE }}
177+
# BUILD_ROOT=/d
178+
# tags: "${{ steps.image_env.outputs.IMAGE_TAG }}-buildroot"
166179
-
167180
name: Upload
168181
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)