From d457426bd1769cfe8884be5c9f3a3c72e5506337 Mon Sep 17 00:00:00 2001 From: James DuHart Date: Fri, 3 Sep 2021 14:54:22 -0500 Subject: [PATCH] Update method for getting ECR credentials Requires a different method for getting ECR credentials and passing to Docker when using AWS CLI 2.0 --- module-2/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module-2/README.md b/module-2/README.md index bc81a6e6..3d3b78bd 100644 --- a/module-2/README.md +++ b/module-2/README.md @@ -150,10 +150,15 @@ New-ECRRepository -RepositoryName mythicalmysfits/service The response to this command will contain additional metadata about the created repository. In order to push container images into our new repository, we will need to obtain authentication credentials for our Docker client to the repository. Run the following command, which will return a login command to retrieve credentials for our Docker client and then automatically execute it (include the full command including the $ below). 'Login Succeeded' will be reported if the command is successful. Run the below command using either the AWS CLI or the PowerShell command: -`Bash` +`Bash: AWS CLI 1.1` ``` $(aws ecr get-login --no-include-email) ``` +`Bash: AWS CLI 2.0` +``` +aws ecr get-login-password --region $(aws configure get region) | docker login --username AWS --password-stdin $(aws sts get-caller-identity --qu +ery Account --output text).dkr.ecr.$(aws configure get region).amazonaws.com +``` `PowerShell` ``` Invoke-Expression $(Get-ECRLoginCommand | Select-Object -ExpandProperty Command)