Provision to specify the image type as OCI or docker v2 in the build and push to docker/ECR registries
long-term
C
Cyan Penguin
Currently there isn't any option to specify the type of image when building an image in build and push to docker registry/ECR steps. It would benefit if there is some sort of flag to be passed in Kaniko from Build and push to ECR step that would specify the image manifest type as OCI or docker v2. And depending on the input from the user, the image should be built with the respective type.
Currently certain services mandate OCI images (Sagemaker for example) and the current workaround is to use skopeo to change the image type after they are pushed to ECR.
Log In
N
Nofar Bluestein
long-term
C
Cyan Penguin
I'm not sure if kaniko supports this as a flag. If not, I believe once kaniko has pushed the image to ECR and freed up the associated local storage these two commands might accomplish a conversion from OCI to docker v2 (other variations might work for converting backwards).
aws ecr get-login-password --region us-west-2 | skopeo login --tls-verify=false --username AWS --password-stdin $account_id.dkr.ecr.us-west-2.amazonaws.com
skopeo --tls-verify=false copy docker://$account_id.dkr.ecr.us-west-2.amazonaws.com/$repo_name:$tag_name docker-archive:/harness/image
skopeo --tls-verify=false copy docker-archive:/harness/image docker://$account_id.dkr.ecr.us-west-2.amazonaws.com/$repo_name:$tag_name