Test building by digest #3
Some checks failed
Build Docker Image / Build ARM64 (3.10) (push) Successful in 1m26s
Build Docker Image / Build AMD64 (3.10) (push) Has been cancelled

This commit is contained in:
2024-12-08 19:02:29 +02:00
parent aec772940e
commit 6f0dc76bfc

View File

@@ -92,36 +92,43 @@ jobs:
provenance: false provenance: false
outputs: type=image,name=gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true outputs: type=image,name=gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true
create-manifest: create-manifest:
needs: [build-amd64, build-arm64] needs: [build-amd64, build-arm64]
runs-on: linux_amd runs-on: ubuntu-latest
name: Create Multi-arch Manifest name: Create Multi-arch Manifest
container: env:
image: catthehacker/ubuntu:act-latest DOCKER_ORG: technocloud-public
env: strategy:
DOCKER_ORG: technocloud-public matrix:
strategy: python-version: ['3.10']
matrix: steps:
python-version: ['3.10'] - name: Login to Docker Registry
steps: uses: docker/login-action@v3
- name: Login to DockerHub with:
uses: docker/login-action@v3 registry: gitea.technocloud.ee
with: username: ${{ secrets.DOCKER_USERNAME }}
registry: gitea.technocloud.ee password: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} - name: Set up Docker BuildX
- name: Get Meta uses: docker/setup-buildx-action@v3
id: meta with:
run: | driver: docker-container
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
- name: Create and Push Manifest - name: Get Repository Metadata
uses: docker/build-push-action@v5 id: meta
with: run: |
context: . echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT
push: true
provenance: false - name: Create and Push Multi-arch Manifest
platforms: linux/amd64,linux/arm64 run: |
tags: gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python${{ matrix.python-version }} IMAGE_NAME=gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python${{ matrix.python-version }}
inputs: | AMD64_DIGEST=${{ needs.build-amd64.outputs['amd64-digest-' + matrix.python-version] }}
amd64=gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}@${{ needs.build-amd64.outputs.amd64-digest-${{ matrix.python-version }} }} ARM64_DIGEST=${{ needs.build-arm64.outputs['arm64-digest-' + matrix.python-version] }}
arm64=gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}@${{ needs.build-arm64.outputs.arm64-digest-${{ matrix.python-version }} }}
# Create the manifest
docker manifest create $IMAGE_NAME \
--amend gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}@$AMD64_DIGEST \
--amend gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}@$ARM64_DIGEST
# Push the manifest
docker manifest push $IMAGE_NAME