Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticate with ECR credential helper for Docker image upload during deployment #3366

Open
patchwork01 opened this issue Sep 26, 2024 · 0 comments

Comments

@patchwork01
Copy link
Collaborator

patchwork01 commented Sep 26, 2024

Background

Our scripts to deploy an instance of Sleeper upload Docker images to AWS ECR before they invoke the AWS CDK to deploy the instance. This is done in the Java class UploadDockerImages. This authenticates to Docker with the AWS CLI.

Description

We'd like to use the AWS ECR Docker Credential Helper to pass login credentials to Docker when uploading images to AWS ECR.

Analysis

Here's the tool we'd like to use:

https://github.com/awslabs/amazon-ecr-credential-helper

We can adapt the code in UploadDockerImages.upload to attempt to use the credential helper by default. It can associate the credential helper with the repository after it creates each repository.

We can keep the option to use the AWS CLI to log in. We could detect which of these are installed. If the credential helper is not installed, we can fail by default, but allow using the AWS CLI instead based on a command line argument.

We can install the credential helper in the builder Docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant