Description
I would like to use crane to make the deployment to different registries easier.
I have one gitlab repo, with one pipeline building a multiarch build to the Gitlab registry.
docker buildx build --platform "linux/amd64,linux/arm64" --build-arg REGISTRY=$TARGET_REGISTRY -t $TARGET_REGISTRY_WITH_NAMESPACE/$IMAGE_NAME:$TARGET_IMAGE_TAG --push .
and then, I would like to push this multarch image to AWS ECR registry (actually a job used twice with 2 different target registries).
- crane auth login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- aws ecr get-login-password --region $AWS_REGION | crane auth login --username AWS --password-stdin $TARGET_REGISTRY
- crane cp $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG $TARGET_REGISTRY_WITH_NAMESPACE/$IMAGE_NAME:$TARGET_IMAGE_TAG
the auth to the 2 registries (gitlab and aws) seems to be ok, but the crane cp always results with a 400:
2022/03/15 15:28:40 failed to copy index: HEAD <aws-registry>/v2/<aws-namespace>/manifests/sha256:fwed95...: unsupported status code 400
Any idea why this 400? Could be more a question for AWS support.
But at the first place, it is supposed to work ? Does crane cp support copying a multi arch image?