I have a GitLab CI job that builds multiple architectures of the same application into docker images. I'd like to push them up to DockerHub without needing to tag each image. That way I can add them to a manifest without polluting the tags directory with a bunch of duplicate images.
For example -- from this set of tags:
- r1234 (a manifest containing the below)
- r1234-amd64
- r1234-arm64
- r1234-armv7
- r1234-gui (a manifest containing the below, each image based on the one above)
- r1234-amd64-gui
- r1234-arm64-gui
- r1234-armv7-gui
to this:
- r1234 (manifest containing the same images, without tags)
- r1234-gui (similarly)
Is this something possible? I made this code right now to push up the tags and make a manifest, but I'm not sure how to adapt it.
- >
for arch in $DEPLOY_ARCHS; do
NEW_IMAGE_NAME="${REPO_PATH}:${REVISION}-${arch}${TAG_EXTRAS}"
docker pull "${INDEV_IMAGE_NAME}-${arch}${TAG_EXTRAS}"
docker tag "${INDEV_IMAGE_NAME}-${arch}${TAG_EXTRAS}" "${NEW_IMAGE_NAME}"
docker push "${NEW_IMAGE_NAME}" # I want to be able to push to the manifest without tagging
export IMAGES="$IMAGES ${NEW_IMAGE_NAME}"
done
- docker manifest create ${REPO_PATH}:${REVISION}${TAG_EXTRAS} ${IMAGES}
- docker manifest push --purge ${REPO_PATH}:${REVISION}${TAG_EXTRAS}
Is this something possible?