Skip to content

Commit 9618cb4

Browse files
authored
Merge pull request #1561 from buildkite/SUP-4593-install-aws-ecr-credential-helper
Install AWS ECR Credential Helper
2 parents 6f52df6 + 0fa37bd commit 9618cb4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packer/linux/scripts/install-docker.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ sudo systemctl start docker-binfmt.service
5858

5959
echo "show docker-binfmt status..."
6060
systemctl status docker-binfmt.service
61+
62+
echo "Installing Amazon ECR credential helper..."
63+
sudo dnf install -y amazon-ecr-credential-helper

packer/windows/scripts/install-docker.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ $docker_compose_version="2.35.1"
1010
Write-Output "Installing docker-compose..."
1111
choco install -y docker-compose --version $docker_compose_version
1212
If ($lastexitcode -ne 0) { Exit $lastexitcode }
13+
14+
Write-Output "Installing Amazon ECR credential helper..."
15+
$ecr_cred_helper_version = "0.10.1"
16+
$ecr_cred_helper_url = "https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/$ecr_cred_helper_version/windows-amd64/docker-credential-ecr-login.exe"
17+
$docker_plugins_dir = "${env:ProgramFiles}\Docker"
18+
New-Item -ItemType Directory -Force -Path $docker_plugins_dir | Out-Null
19+
Invoke-WebRequest -Uri $ecr_cred_helper_url -OutFile "$docker_plugins_dir\docker-credential-ecr-login.exe"
20+
Write-Output "Amazon ECR credential helper v$ecr_cred_helper_version installed to $docker_plugins_dir"

0 commit comments

Comments
 (0)