feat: Use skopeo copy to create multi-arch tags.

* Avoid plain `docker tag` to create stable/versioned tags, as this
  creates single architecture image tags, instead of a new manifest list
* Use `skopeo copy` instead for this!
This commit is contained in:
Peter Johanson 2022-10-26 00:09:30 -04:00 committed by Pete Johanson
parent 64526ce2de
commit 0793ce8183

View File

@ -560,6 +560,8 @@ jobs:
- build - build
- dev - dev
steps: steps:
- name: Install skopeo
run: sudo apt-get install -y skopeo
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr-login id: ghcr-login
uses: docker/login-action@v1 uses: docker/login-action@v1
@ -585,18 +587,11 @@ jobs:
run: | run: |
REPOSITORY=zmk-${TARGET}-${ARCHITECTURE} REPOSITORY=zmk-${TARGET}-${ARCHITECTURE}
docker pull docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://docker.io/${DHNS}/${REPOSITORY}:${VERSIONS}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker.io/${DHNS}/${REPOSITORY}:${VERSIONS} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://docker.io/${DHNS}/${REPOSITORY}:${MAJOR_MINOR}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker.io/${DHNS}/${REPOSITORY}:${MAJOR_MINOR} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://ghcr.io/${GHCRNS}/${REPOSITORY}:${CANDIDATE}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} ghcr.io/${GHCRNS}/${REPOSITORY}:${CANDIDATE} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://ghcr.io/${GHCRNS}/${REPOSITORY}:${VERSIONS}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} ghcr.io/${GHCRNS}/${REPOSITORY}:${VERSIONS} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://ghcr.io/${GHCRNS}/${REPOSITORY}:${MAJOR_MINOR}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} ghcr.io/${GHCRNS}/${REPOSITORY}:${MAJOR_MINOR}
docker push docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE}
docker push docker.io/${DHNS}/${REPOSITORY}:${VERSIONS}
docker push docker.io/${DHNS}/${REPOSITORY}:${MAJOR_MINOR}
docker push ghcr.io/${GHCRNS}/${REPOSITORY}:${CANDIDATE}
docker push ghcr.io/${GHCRNS}/${REPOSITORY}:${VERSIONS}
docker push ghcr.io/${GHCRNS}/${REPOSITORY}:${MAJOR_MINOR}
git-tag: git-tag:
needs: needs:
- tags - tags
@ -643,6 +638,8 @@ jobs:
- build - build
- dev - dev
steps: steps:
- name: Install skopeo
run: sudo apt-get install -y skopeo
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr-login id: ghcr-login
uses: docker/login-action@v1 uses: docker/login-action@v1
@ -666,10 +663,7 @@ jobs:
run: | run: |
REPOSITORY=zmk-${TARGET}-${ARCHITECTURE} REPOSITORY=zmk-${TARGET}-${ARCHITECTURE}
docker pull docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://docker.io/${DHNS}/${REPOSITORY}:stable
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker.io/${DHNS}/${REPOSITORY}:stable
docker push docker.io/${DHNS}/${REPOSITORY}:stable
stable-git-tag: stable-git-tag:
needs: needs:
- tags - tags