sbt-ecr
sbt-ecr copied to clipboard
denied: Your Authorization Token has expired. Please run 'aws ecr get-login' to fetch a new one.
Hi,
I am getting the following error:
denied: Your Authorization Token has expired. Please run 'aws ecr get-login' to fetch a new one.
Before the push, I can see:
[info] AWS account id: 07579032XXXX The push refers to repository [07579032XXXX.dkr.ecr.ap-south-1.amazonaws.com/XXXX-service]
Which seems to suggest that the login was succesful.
Any ideas what may be the issue? (full log is attached)
Hi @eugenemiretsky,
Did you run ecr:login
before ecr:push
?
A successful login should look something like this in the current plugin version (from the sbt
shell):
[my-project] $ ecr:login
[info] AWS account id: XXXXXXXXXXX
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
[success] Total time: 4 s, completed Feb 11, 2018 4:28:21 AM
[my-project] $
The following line is responsible for doing that automatically in the sample config (the one in README.md
):
// Authenticate and publish a local Docker image before pushing to ECR
push in Ecr := ((push in Ecr) dependsOn (publishLocal in Docker, login in Ecr)).value