我维护一个docker映像,它封装了一个著名的漫画库程序。我将这个映像设计为多arch响应,使用两个不同版本的捆绑软件(一个使用p7zip
进行解压,一个使用unarr
,每个版本有三个不同的Dockerfiles (amd64, arm63v8和arm32v7)。在创建新的Github版本时,我使用Github Actions工作流来构建和推送每个图像到Docker Hub和Github容器注册表,然后创建和推送一个清单,该清单将不同的图像标签捆绑在一起,在元标签latest
,unarr
,p7zip
下。直到最近,这个工作流程还没有任何问题,但由于某种原因,我的工作流程的push-manifest
部分在我最近的版本中开始失败。在Github运行器上运行的docker命令行似乎无法拉非amd64图像,尽管我在工作流程中设置了QEMU和Buildx。有什么好主意吗?
这是工作流失败部分的错误日志:
Run docker pull ***/yacreaderlibrary-server-docker:unarr-amd64
docker pull ***/yacreaderlibrary-server-docker:unarr-amd64
docker pull ***/yacreaderlibrary-server-docker:unarr-arm64v8
docker pull ***/yacreaderlibrary-server-docker:unarr-arm32v7
docker pull ***/yacreaderlibrary-server-docker:latest-amd64
docker pull ***/yacreaderlibrary-server-docker:latest-arm64v8
docker pull ***/yacreaderlibrary-server-docker:latest-arm32v7
docker pull ***/yacreaderlibrary-server-docker:p7zip-amd64
docker pull ***/yacreaderlibrary-server-docker:p7zip-arm64v8
docker pull ***/yacreaderlibrary-server-docker:p7zip-arm32v7
docker manifest create ***/yacreaderlibrary-server-docker:unarr ***/yacreaderlibrary-server-docker:unarr-amd64 ***/yacreaderlibrary-server-docker:unarr-arm64v8 ***/yacreaderlibrary-server-docker:unarr-arm32v7
docker manifest annotate ***/yacreaderlibrary-server-docker:unarr ***/yacreaderlibrary-server-docker:unarr-amd64 --arch amd64
docker manifest annotate ***/yacreaderlibrary-server-docker:unarr ***/yacreaderlibrary-server-docker:unarr-arm64v8 --arch arm64
docker manifest annotate ***/yacreaderlibrary-server-docker:unarr ***/yacreaderlibrary-server-docker:unarr-arm32v7 --arch arm
docker manifest push ***/yacreaderlibrary-server-docker:unarr
docker manifest create ***/yacreaderlibrary-server-docker:p7zip ***/yacreaderlibrary-server-docker:p7zip-amd64 ***/yacreaderlibrary-server-docker:p7zip-arm64v8 ***/yacreaderlibrary-server-docker:p7zip-arm32v7
docker manifest annotate ***/yacreaderlibrary-server-docker:p7zip ***/yacreaderlibrary-server-docker:p7zip-amd64 --arch amd64
docker manifest annotate ***/yacreaderlibrary-server-docker:p7zip ***/yacreaderlibrary-server-docker:p7zip-arm64v8 --arch arm64
docker manifest annotate ***/yacreaderlibrary-server-docker:p7zip ***/yacreaderlibrary-server-docker:p7zip-arm32v7 --arch arm
docker manifest push ***/yacreaderlibrary-server-docker:p7zip
docker manifest create ***/yacreaderlibrary-server-docker:latest ***/yacreaderlibrary-server-docker:latest-amd64 ***/yacreaderlibrary-server-docker:latest-arm64v8 ***/yacreaderlibrary-server-docker:latest-arm32v7
docker manifest annotate ***/yacreaderlibrary-server-docker:latest ***/yacreaderlibrary-server-docker:latest-amd64 --arch amd64
docker manifest annotate ***/yacreaderlibrary-server-docker:latest ***/yacreaderlibrary-server-docker:latest-arm64v8 --arch arm64
docker manifest annotate ***/yacreaderlibrary-server-docker:latest ***/yacreaderlibrary-server-docker:latest-arm32v7 --arch arm
docker manifest push ***/yacreaderlibrary-server-docker:latest
docker pull ***/yacreaderlibrary-server-docker:v1.4.0-amd64
docker pull ***/yacreaderlibrary-server-docker:v1.4.0-arm64v8
docker pull ***/yacreaderlibrary-server-docker:v1.4.0-arm32v7
docker manifest create ***/yacreaderlibrary-server-docker:v1.4.0 ***/yacreaderlibrary-server-docker:v1.4.0-amd64 ***/yacreaderlibrary-server-docker:v1.4.0-arm64v8 ***/yacreaderlibrary-server-docker:v1.4.0-arm32v7
docker manifest annotate ***/yacreaderlibrary-server-docker:v1.4.0 ***/yacreaderlibrary-server-docker:v1.4.0-amd64 --arch amd64
docker manifest annotate ***/yacreaderlibrary-server-docker:v1.4.0 ***/yacreaderlibrary-server-docker:v1.4.0-arm64v8 --arch arm64
docker manifest annotate ***/yacreaderlibrary-server-docker:v1.4.0 ***/yacreaderlibrary-server-docker:v1.4.0-arm32v7 --arch arm
docker manifest push ***/yacreaderlibrary-server-docker:v1.4.0
shell: /usr/bin/bash -e {0}
env:
DOCKERHUB_SLUG: ***/yacreaderlibrary-server-docker
GHCR_SLUG: ghcr.io/***/yacreaderlibrary-server-docker
DOCKER_METADATA_OUTPUT_VERSION: v1.4.0
DOCKER_METADATA_OUTPUT_TAGS: ghcr.io/***/yacreaderlibrary-server-docker:v1.4.0
DOCKER_METADATA_OUTPUT_LABELS: org.opencontainers.image.title=yacreaderlibrary-server-docker
org.opencontainers.image.description=Docker image running a headless version of YACReaderLibraryServer 📦
org.opencontainers.image.url=https://github.com/***/yacreaderlibrary-server-docker
org.opencontainers.image.source=https://github.com/***/yacreaderlibrary-server-docker
org.opencontainers.image.version=v1.4.0
org.opencontainers.image.created=2023-03-31T17:49:43.131Z
org.opencontainers.image.revision=6b991e77e2d8b4ca51eec334f3ea18cf3d9b2aba
org.opencontainers.image.licenses=GPL-3.0
DOCKER_METADATA_OUTPUT_JSON: {"tags":["ghcr.io/***/yacreaderlibrary-server-docker:v1.4.0"],"labels":{"org.opencontainers.image.title":"yacreaderlibrary-server-docker","org.opencontainers.image.description":"Docker image running a headless version of YACReaderLibraryServer 📦","org.opencontainers.image.url":"https://github.com/***/yacreaderlibrary-server-docker","org.opencontainers.image.source":"https://github.com/***/yacreaderlibrary-server-docker","org.opencontainers.image.version":"v1.4.0","org.opencontainers.image.created":"2023-03-31T17:49:43.131Z","org.opencontainers.image.revision":"6b991e77e2d8b4ca51eec334f3ea18cf3d9b2aba","org.opencontainers.image.licenses":"GPL-3.0"}}
DOCKER_METADATA_OUTPUT_BAKE_FILE: /tmp/docker-metadata-action-QrbYCu/docker-metadata-action-bake.json
unarr-amd64: Pulling from ***/yacreaderlibrary-server-docker
38a8b9979b0c: Pulling fs layer
48f754c837b5: Pulling fs layer
e62f0384a36b: Pulling fs layer
776e56018534: Pulling fs layer
22883c3dda69: Pulling fs layer
2d428c86948e: Pulling fs layer
22b0bae01498: Pulling fs layer
776e56018534: Waiting
22883c3dda69: Waiting
22b0bae01498: Waiting
2d428c86948e: Waiting
48f754c837b5: Verifying Checksum
48f754c837b5: Download complete
e62f0384a36b: Download complete
22883c3dda69: Verifying Checksum
22883c3dda69: Download complete
776e56018534: Verifying Checksum
776e56018534: Download complete
38a8b9979b0c: Verifying Checksum
38a8b9979b0c: Download complete
22b0bae01498: Verifying Checksum
22b0bae01498: Download complete
38a8b9979b0c: Pull complete
48f754c837b5: Pull complete
e62f0384a36b: Pull complete
2d428c86948e: Verifying Checksum
2d428c86948e: Download complete
776e56018534: Pull complete
22883c3dda69: Pull complete
2d428c86948e: Pull complete
22b0bae01498: Pull complete
Digest: sha256:c9ec7712740535ef92317ee93626cbd46e2a0c369a034799e3707558fa6899da
Status: Downloaded newer image for ***/yacreaderlibrary-server-docker:unarr-amd64
docker.io/***/yacreaderlibrary-server-docker:unarr-amd64
unarr-arm64v8: Pulling from ***/yacreaderlibrary-server-docker
no matching manifest for linux/amd64 in the manifest list entries
Error: Process completed with exit code 1.
这是我的工作流程:
---
# Builds our multi-arch Docker images for p7zip and unarr versions of YACReaderLibraryServer
name: Build and push images
on:
release:
types: [published]
workflow_dispatch:
env:
DOCKERHUB_SLUG: xthursdayx/yacreaderlibrary-server-docker
GHCR_SLUG: ghcr.io/xthursdayx/yacreaderlibrary-server-docker
jobs:
build-unarr-amd64:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Docker meta
id: dh-meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKERHUB_SLUG }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Docker meta
id: gh-meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.GHCR_SLUG }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
uses: docker/build-push-action@v4
with:
context: unarr
file: unarr/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ env.DOCKERHUB_SLUG }}:unarr-amd64
${{ env.DOCKERHUB_SLUG }}:latest-amd64
${{ env.GHCR_SLUG }}:unarr-amd64
${{ env.GHCR_SLUG }}:latest-amd64
${{ steps.dh-meta.outputs.tags }}-amd64
${{ steps.gh-meta.outputs.tags }}-amd64
labels: ${{ steps.dh-meta.outputs.labels }}
build-unarr-arm64v8:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: dh-meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKERHUB_SLUG }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Docker meta
id: gh-meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.GHCR_SLUG }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
uses: docker/build-push-action@v4
with:
push: true
context: unarr
file: unarr/Dockerfile.aarch64
platforms: linux/arm64/v8
tags: |
${{ env.DOCKERHUB_SLUG }}:unarr-arm64v8
${{ env.DOCKERHUB_SLUG }}:latest-arm64v8
${{ env.GHCR_SLUG }}:unarr-arm64v8
${{ env.GHCR_SLUG }}:latest-arm64v8
${{ steps.dh-meta.outputs.tags }}-arm64v8
${{ steps.gh-meta.outputs.tags }}-arm64v8
labels: ${{ steps.dh-meta.outputs.labels }}
build-unarr-arm32v7:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: dh-meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKERHUB_SLUG }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Docker meta
id: gh-meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.GHCR_SLUG }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
uses: docker/build-push-action@v4
with:
push: true
context: unarr
file: unarr/Dockerfile.armhf
platforms: linux/arm/v7
tags: |
${{ env.DOCKERHUB_SLUG }}:unarr-arm32v7
${{ env.DOCKERHUB_SLUG }}:latest-arm32v7
${{ env.GHCR_SLUG }}:unarr-arm32v7
${{ env.GHCR_SLUG }}:latest-arm32v7
${{ steps.dh-meta.outputs.tags }}-arm32v7
${{ steps.gh-meta.outputs.tags }}-arm32v7
labels: ${{ steps.dh-meta.outputs.labels }}
build-p7zip-amd64:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
uses: docker/build-push-action@v4
with:
push: true
context: p7zip
file: p7zip/Dockerfile
platforms: linux/amd64
tags: |
${{ env.DOCKERHUB_SLUG }}:p7zip-amd64
${{ env.GHCR_SLUG }}:p7zip-amd64
build-p7zip-arm64v8:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
uses: docker/build-push-action@v4
with:
push: true
context: p7zip
file: p7zip/Dockerfile.aarch64
platforms: linux/arm64/v8
tags: |
${{ env.DOCKERHUB_SLUG }}:p7zip-arm64v8
${{ env.GHCR_SLUG }}:p7zip-arm64v8
build-p7zip-arm32v7:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
uses: docker/build-push-action@v4
with:
push: true
context: p7zip
file: p7zip/Dockerfile.armhf
platforms: linux/arm/v7
tags: |
${{ env.DOCKERHUB_SLUG }}:p7zip-arm32v7
${{ env.GHCR_SLUG }}:p7zip-arm32v7
push-manifest:
needs: [build-unarr-amd64, build-unarr-arm64v8, build-unarr-arm32v7, build-p7zip-amd64, build-p7zip-arm64v8, build-p7zip-arm32v7]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: dh-meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKERHUB_SLUG }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Docker meta
id: gh-meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.GHCR_SLUG }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest for multi-arch images @ Docker Hub
run: |
docker pull ${{ env.DOCKERHUB_SLUG }}:unarr-amd64
docker pull ${{ env.DOCKERHUB_SLUG }}:unarr-arm64v8
docker pull ${{ env.DOCKERHUB_SLUG }}:unarr-arm32v7
docker pull ${{ env.DOCKERHUB_SLUG }}:latest-amd64
docker pull ${{ env.DOCKERHUB_SLUG }}:latest-arm64v8
docker pull ${{ env.DOCKERHUB_SLUG }}:latest-arm32v7
docker pull ${{ env.DOCKERHUB_SLUG }}:p7zip-amd64
docker pull ${{ env.DOCKERHUB_SLUG }}:p7zip-arm64v8
docker pull ${{ env.DOCKERHUB_SLUG }}:p7zip-arm32v7
docker manifest create ${{ env.DOCKERHUB_SLUG }}:unarr ${{ env.DOCKERHUB_SLUG }}:unarr-amd64 ${{ env.DOCKERHUB_SLUG }}:unarr-arm64v8 ${{ env.DOCKERHUB_SLUG }}:unarr-arm32v7
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:unarr ${{ env.DOCKERHUB_SLUG }}:unarr-amd64 --arch amd64
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:unarr ${{ env.DOCKERHUB_SLUG }}:unarr-arm64v8 --arch arm64
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:unarr ${{ env.DOCKERHUB_SLUG }}:unarr-arm32v7 --arch arm
docker manifest push ${{ env.DOCKERHUB_SLUG }}:unarr
docker manifest create ${{ env.DOCKERHUB_SLUG }}:p7zip ${{ env.DOCKERHUB_SLUG }}:p7zip-amd64 ${{ env.DOCKERHUB_SLUG }}:p7zip-arm64v8 ${{ env.DOCKERHUB_SLUG }}:p7zip-arm32v7
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:p7zip ${{ env.DOCKERHUB_SLUG }}:p7zip-amd64 --arch amd64
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:p7zip ${{ env.DOCKERHUB_SLUG }}:p7zip-arm64v8 --arch arm64
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:p7zip ${{ env.DOCKERHUB_SLUG }}:p7zip-arm32v7 --arch arm
docker manifest push ${{ env.DOCKERHUB_SLUG }}:p7zip
docker manifest create ${{ env.DOCKERHUB_SLUG }}:latest ${{ env.DOCKERHUB_SLUG }}:latest-amd64 ${{ env.DOCKERHUB_SLUG }}:latest-arm64v8 ${{ env.DOCKERHUB_SLUG }}:latest-arm32v7
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:latest ${{ env.DOCKERHUB_SLUG }}:latest-amd64 --arch amd64
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:latest ${{ env.DOCKERHUB_SLUG }}:latest-arm64v8 --arch arm64
docker manifest annotate ${{ env.DOCKERHUB_SLUG }}:latest ${{ env.DOCKERHUB_SLUG }}:latest-arm32v7 --arch arm
docker manifest push ${{ env.DOCKERHUB_SLUG }}:latest
docker pull ${{ steps.dh-meta.outputs.tags }}-amd64
docker pull ${{ steps.dh-meta.outputs.tags }}-arm64v8
docker pull ${{ steps.dh-meta.outputs.tags }}-arm32v7
docker manifest create ${{ steps.dh-meta.outputs.tags }} ${{ steps.dh-meta.outputs.tags }}-amd64 ${{ steps.dh-meta.outputs.tags }}-arm64v8 ${{ steps.dh-meta.outputs.tags }}-arm32v7
docker manifest annotate ${{ steps.dh-meta.outputs.tags }} ${{ steps.dh-meta.outputs.tags }}-amd64 --arch amd64
docker manifest annotate ${{ steps.dh-meta.outputs.tags }} ${{ steps.dh-meta.outputs.tags }}-arm64v8 --arch arm64
docker manifest annotate ${{ steps.dh-meta.outputs.tags }} ${{ steps.dh-meta.outputs.tags }}-arm32v7 --arch arm
docker manifest push ${{ steps.dh-meta.outputs.tags }}
- name: Create manifest for multi-arch images @ GHCR
run: |
docker pull ${{ env.GHCR_SLUG }}:unarr-amd64
docker pull ${{ env.GHCR_SLUG }}:unarr-arm64v8
docker pull ${{ env.GHCR_SLUG }}:unarr-arm32v7
docker pull ${{ env.GHCR_SLUG }}:latest-amd64
docker pull ${{ env.GHCR_SLUG }}:latest-arm64v8
docker pull ${{ env.GHCR_SLUG }}:latest-arm32v7
docker pull ${{ env.GHCR_SLUG }}:p7zip-amd64
docker pull ${{ env.GHCR_SLUG }}:p7zip-arm64v8
docker pull ${{ env.GHCR_SLUG }}:p7zip-arm32v7
docker manifest create ${{ env.GHCR_SLUG }}:unarr ${{ env.GHCR_SLUG }}:unarr-amd64 ${{ env.GHCR_SLUG }}:unarr-arm64v8 ${{ env.GHCR_SLUG }}:unarr-arm32v7
docker manifest annotate ${{ env.GHCR_SLUG }}:unarr ${{ env.GHCR_SLUG }}:unarr-amd64 --arch amd64
docker manifest annotate ${{ env.GHCR_SLUG }}:unarr ${{ env.GHCR_SLUG }}:unarr-arm64v8 --arch arm64
docker manifest annotate ${{ env.GHCR_SLUG }}:unarr ${{ env.GHCR_SLUG }}:unarr-arm32v7 --arch arm
docker manifest push ${{ env.GHCR_SLUG }}:unarr
docker manifest create ${{ env.GHCR_SLUG }}:p7zip ${{ env.GHCR_SLUG }}:p7zip-amd64 ${{ env.GHCR_SLUG }}:p7zip-arm64v8 ${{ env.GHCR_SLUG }}:p7zip-arm32v7
docker manifest annotate ${{ env.GHCR_SLUG }}:p7zip ${{ env.GHCR_SLUG }}:p7zip-amd64 --arch amd64
docker manifest annotate ${{ env.GHCR_SLUG }}:p7zip ${{ env.GHCR_SLUG }}:p7zip-arm64v8 --arch arm64
docker manifest annotate ${{ env.GHCR_SLUG }}:p7zip ${{ env.GHCR_SLUG }}:p7zip-arm32v7 --arch arm
docker manifest push ${{ env.GHCR_SLUG }}:p7zip
docker manifest create ${{ env.GHCR_SLUG }}:latest ${{ env.GHCR_SLUG }}:latest-amd64 ${{ env.GHCR_SLUG }}:latest-arm64v8 ${{ env.GHCR_SLUG }}:latest-arm32v7
docker manifest annotate ${{ env.GHCR_SLUG }}:latest ${{ env.GHCR_SLUG }}:latest-amd64 --arch amd64
docker manifest annotate ${{ env.GHCR_SLUG }}:latest ${{ env.GHCR_SLUG }}:latest-arm64v8 --arch arm64
docker manifest annotate ${{ env.GHCR_SLUG }}:latest ${{ env.GHCR_SLUG }}:latest-arm32v7 --arch arm
docker manifest push ${{ env.GHCR_SLUG }}:latest
docker pull ${{ steps.gh-meta.outputs.tags }}-amd64
docker pull ${{ steps.gh-meta.outputs.tags }}-arm64v8
docker pull ${{ steps.gh-meta.outputs.tags }}-arm32v7
docker manifest create ${{ steps.gh-meta.outputs.tags }} ${{ steps.gh-meta.outputs.tags }}-amd64 ${{ steps.gh-meta.outputs.tags }}-arm64v8 ${{ steps.gh-meta.outputs.tags }}-arm32v7
docker manifest annotate ${{ steps.gh-meta.outputs.tags }} ${{ steps.gh-meta.outputs.tags }}-amd64 --arch amd64
docker manifest annotate ${{ steps.gh-meta.outputs.tags }} ${{ steps.gh-meta.outputs.tags }}-arm64v8 --arch arm64
docker manifest annotate ${{ steps.gh-meta.outputs.tags }} ${{ steps.gh-meta.outputs.tags }}-arm32v7 --arch arm
docker manifest push ${{ steps.gh-meta.outputs.tags }}
这是由docker向映像添加证明元数据的方式触发的。通过从镜像清单切换到多平台清单,使用单个平台镜像和unknown/unknown
平台的认证,如果没有额外的选项,从不同平台的docker pull将不再工作。
您可以:
- 关闭认证生成(我相信每个构建都是
attests: false
,参见build-push-action中的选项)。 - 每次拉取时使用
--platform ...
通过平台拉取图像。 - 重构构建,这样你就可以在所有平台上运行单个构建(docker有一个2平台的例子,展示了如何用逗号分隔列表列出要构建的每个平台)。
我个人选择方法3,因为它更干净,但这需要重新设计你的Dockerfiles,使它们不是特定于平台的。
我还编写了一个名为regclient的工具,regctl index create
命令与--ref
和--platform
选项列表可能会更快,因为它会避免拉(所有blobs都保留在注册表上)。