Skip to content

Commit

Permalink
fixed ECR login command
Browse files Browse the repository at this point in the history
  • Loading branch information
agnis-mateuss committed Sep 15, 2023
1 parent 6b2a33c commit eec257b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/ciImageLogin.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ Available flags and environment variables:
if err != nil {
log.Fatal("Error:", err)
}
//Remove newline
awsAccountId = []byte(strings.TrimSuffix(string(awsAccountId), "\n"))
// ECR login
command = fmt.Sprintf("aws ecr get-login-password --region %q | docker login --username AWS --password-stdin %s.dkr.ecr.%q.amazonaws.com", awsRegion, awsAccountId, awsRegion)
command = fmt.Sprintf("aws ecr get-login-password --region %s | docker login --username AWS --password-stdin %s.dkr.ecr.%s.amazonaws.com", awsRegion, awsAccountId, awsRegion)
// TODO: use aws cli v2
// command = fmt.Sprintf("echo %q | docker login --username AWS --password-stdin %s", awsSecretAccessKey, imageRepoHost)

Expand Down

0 comments on commit eec257b

Please sign in to comment.