Selin
Selin

Reputation: 41

"no basic auth credentials" docker push

I tried to push the Docker container. But it gave me a "no basic auth credentials" error. Even I used aws ecr get-login-password and entered my credentials with docker configure and managed to create repository from terminal in AWS, pushing did not work. Does anybody know why I cannot push to AWS?

I used docker push <my-account-id>.dkr.ecr.us-east-1.amazonaws.com/<awsrepo-details>:latest to push the image

Thank in advance.

Upvotes: 3

Views: 11751

Answers (1)

scroveez
scroveez

Reputation: 160

it is authentication, first retrieve an authentication token and authenticate your Docker client to your registry:

aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin {account_id}.dkr.ecr.ap-south-1.amazonaws.com

after you build and tag, push depending on your tag:

docker push ${account_id}.dkr.ecr.ap-south-1.amazonaws.com/${repo_name}:latest

Upvotes: 7

Related Questions