If you are getting here because you are trying to use aws sam and get this error with sam local invoke
Then what made it work for me was deleting the credsStore
key/val which is located in ~/.docker/config.json
. Which I found in this github issue