From 4efeab569089d03dbef2783b0e28d515ccc5df0b Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Mon, 21 Aug 2023 12:03:15 +0000 Subject: [PATCH 1/2] push regular images instead of manifest in case of single arch on gitlab --- .gitlab-ci/docker-ros.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 9554ebb..10cbfc3 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -250,18 +250,33 @@ Test run-arm64: script: - |- if [[ "${PLATFORM}" =~ amd64 && "${PLATFORM}" =~ arm64 ]]; then - if [[ "${TARGET}" =~ dev ]]; then docker manifest create ${IMG_DEV} --amend ${_IMAGE_DEV_CI_AMD64} --amend ${_IMAGE_DEV_CI_ARM64}; fi - if [[ "${TARGET}" =~ run ]]; then docker manifest create ${IMG_RUN} --amend ${_IMAGE_RUN_CI_AMD64} --amend ${_IMAGE_RUN_CI_ARM64}; fi + if [[ "${TARGET}" =~ dev ]]; then + docker manifest create ${IMG_DEV} --amend ${_IMAGE_DEV_CI_AMD64} --amend ${_IMAGE_DEV_CI_ARM64} + docker manifest push ${IMG_DEV} + fi + if [[ "${TARGET}" =~ run ]]; then + docker manifest create ${IMG_RUN} --amend ${_IMAGE_RUN_CI_AMD64} --amend ${_IMAGE_RUN_CI_ARM64} + docker manifest push ${IMG_RUN} + fi elif [[ "${PLATFORM}" =~ amd64 ]]; then - if [[ "${TARGET}" =~ dev ]]; then docker manifest create ${IMG_DEV} --amend ${_IMAGE_DEV_CI_AMD64}; fi - if [[ "${TARGET}" =~ run ]]; then docker manifest create ${IMG_RUN} --amend ${_IMAGE_RUN_CI_AMD64}; fi + if [[ "${TARGET}" =~ dev ]]; then + docker tag ${_IMAGE_DEV_CI_AMD64} ${IMG_DEV} + docker push ${IMG_DEV} + fi + if [[ "${TARGET}" =~ run ]]; then + docker tag ${_IMAGE_RUN_CI_AMD64} ${IMG_RUN} + docker push ${IMG_RUN} + fi elif [[ "${PLATFORM}" =~ arm64 ]]; then - if [[ "${TARGET}" =~ dev ]]; then docker manifest create ${IMG_DEV} --amend ${_IMAGE_DEV_CI_ARM64}; fi - if [[ "${TARGET}" =~ run ]]; then docker manifest create ${IMG_RUN} --amend ${_IMAGE_RUN_CI_ARM64}; fi + if [[ "${TARGET}" =~ dev ]]; then + docker tag ${_IMAGE_DEV_CI_ARM64} ${IMG_DEV} + docker push ${IMG_DEV} + fi + if [[ "${TARGET}" =~ run ]]; then + docker tag ${_IMAGE_RUN_CI_ARM64} ${IMG_RUN} + docker push ${IMG_RUN} + fi fi - - |- - if [[ "${TARGET}" =~ dev ]]; then docker manifest push ${IMG_DEV}; fi - if [[ "${TARGET}" =~ run ]]; then docker manifest push ${IMG_RUN}; fi Push CI: stage: Push Multi-Arch Images From b7fcb3f809c9fdc95344bcc168eaed05fe516087 Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Mon, 21 Aug 2023 12:36:50 +0000 Subject: [PATCH 2/2] pull before re-tagging single-arch final images --- .gitlab-ci/docker-ros.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 10cbfc3..84078a4 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -260,19 +260,23 @@ Test run-arm64: fi elif [[ "${PLATFORM}" =~ amd64 ]]; then if [[ "${TARGET}" =~ dev ]]; then + docker pull ${_IMAGE_DEV_CI_AMD64} docker tag ${_IMAGE_DEV_CI_AMD64} ${IMG_DEV} docker push ${IMG_DEV} fi if [[ "${TARGET}" =~ run ]]; then + docker pull ${_IMAGE_RUN_CI_AMD64} docker tag ${_IMAGE_RUN_CI_AMD64} ${IMG_RUN} docker push ${IMG_RUN} fi elif [[ "${PLATFORM}" =~ arm64 ]]; then if [[ "${TARGET}" =~ dev ]]; then + docker pull ${_IMAGE_DEV_CI_ARM64} docker tag ${_IMAGE_DEV_CI_ARM64} ${IMG_DEV} docker push ${IMG_DEV} fi if [[ "${TARGET}" =~ run ]]; then + docker pull ${_IMAGE_RUN_CI_ARM64} docker tag ${_IMAGE_RUN_CI_ARM64} ${IMG_RUN} docker push ${IMG_RUN} fi