aws-codebuild-docker-images icon indicating copy to clipboard operation
aws-codebuild-docker-images copied to clipboard

Should images ship with `docker-credential-ecr-login` pre-installed and configured?

Open moltar opened this issue 1 year ago • 2 comments

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

It seems like a massive improvement over the classic:

aws ecr get-login-password --region=foo | \
  docker login --username AWS --password-stdin repository-uri

moltar avatar Sep 25 '24 14:09 moltar

It looks like the package is already included but needs to be configured.

jplock avatar Oct 03 '24 01:10 jplock

Hm, that's interesting because I don't see it on the aws/codebuild/standard:7.0 image:

#2 ERROR: error getting credentials - err: exec: "docker-credential-ecr-login": executable file not found in $PATH, out: ``

moltar avatar Oct 03 '24 11:10 moltar

docker-credential-ecr-login has been pre-installed in latest version of ubuntu:7.0 image. You can configure it by adding the following commands in your buildspec:

phases:
  install:
    commands:
      - mkdir -p ~/.docker
      - "echo '{\"credsStore\": \"ecr-login\"}' > ~/.docker/config.json"

It is not pre-configured in image because configuring it would cause docker login commands to fail.

xinyu-aws avatar Jan 30 '25 00:01 xinyu-aws