'Colima | Pushing ECR on AWS | failed to create LLB definition

Recently, docker desktop became paid software so I installed colima on MacOS

Now, when I am trying to push my code to AWS ECR using the following command:

aws ecr get-login-password --region ${region} | 
docker login --username AWS --password $(aws ecr 
get-login-password --region us-XXXX-1) XXXXX.dkr.ecr.us-XXXX-1.amazonaws.com

I am getting this error:

failed to solve with frontend dockerfile.v0: failed to create LLB definition: 
rpc error: code = Unknown desc = error getting credentials - err: exec: "docker- 
credential-desktop": executable file not found in $PATH, out: ``

After debugging, I found the main issue with the docker login, when I separately tried to login using "docker login", I am getting the same error.

I tried below command too but its not working:

colima nerdctl install --path "${HOME}/opt/bin/docker"

Can someone please suggest my next steps?



Solution 1:[1]

Remove the credsStore config from ~/.docker/config.json

It probably defines the credential store, and does not work:

"credsStore": "desktop",

Ref

Solution 2:[2]

I propose removing docker config file.

https://github.com/abiosoft/colima/issues/52#issuecomment-956036733

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Efren
Solution 2 Yunnosch