How to add amazon-ecr-credential-helper to path
Steps to set up Credential helper on Ubuntu.
This assumes, you have docker installed and AWS credentials available at: ~/.aws/credentials file
- Clone the git repository https://github.com/awslabs/amazon-ecr-credential-helper.git
- cd to the cloned folder "amazon-ecr-credential-helper"
- run the command on terminal "make docker"
- it will create the binary "./bin/local/docker-credential-ecr-login"
- Copy this binary to /usr/bin/lib with the command " sudo cp ./bin/local/docker-credential-ecr-login /usr/bin/lib/docker-credential-ecr-login
-
Create or modify the docker config.json file available at /.docker/config.json with the below content
{ "credsStore": "ecr-login" }
then try pushing the docker image to AWS ECR repository
Ravneet Arora(DevOps)
Related videos on Youtube
CorayThan
Professional software developer and gamer. Check out my collectible card game website for KeyForge! https://decksofkeyforge.com/
Updated on September 18, 2022Comments
-
CorayThan over 1 year
I'm trying to set up amazon-ecr-credential-helper so that I can have an ansible script automatically push / pull to my aws ecr docker repository, but the instructions for installing it seem very vague.
Since I already have Docker installed I tried cloning the repo and running
make docker
. It says that outputs the binary "to local directory." Which appeared to be true, I ended up with./bin/local/docker-credential-ecr-login
being built. So I tried adding that to my path:.bash_profile
export PATH="$HOME/anaconda3/bin:$HOME/projects/amazon-ecr-credential-helper/bin:$PATH"
And restarting my terminal, but when I try to do a docker push I get the error
no basic auth credentials
.And if I try to do a
docker-compose build
I get the errorCredentials store error: StoreError('docker-credential-ecr-login not installed or not available in PATH',)
.-
strongjz about 6 yearsWhy not just move the binary to /usr/local/bin ? And did you update the ~/.docker/config.json like the repo says?
-
CorayThan about 6 years@strongjz Yeah, I did update the docker config like the docs suggest. Tried moving the binary to
/usr/local/bin
and restarting, but that didn't make it any better. Appreciate the advice, but I think I'll just side-step the issue and do it manually or do it with Ansible a different way! -
Phil about 6 yearsReceived this error when upgrading to Mac OS High Sierra. It seems to have deleted my ECR credentials helper from
/usr/bin
but kept the reference to it in$HOME/.docker/config.json
I just removed the reference to "ecr-login" in myconfig.json
and everything works again!
-
-
JoanComasFdz about 5 yearsAny idea on how to do this on Windows 10?
-
Jacques Koorts over 4 yearsFor mint 5. sudo cp ./bin/local/docker-credential-ecr-login /usr/bin/docker-credential-ecr-login. Also 6 refers to your home dir
-
Fumisky Wells over 4 yearsFor Ubuntu, the destination path for cp would be /usr/bin/ or /usr/local/bin rather than /usr/bin/lib, right?