We recently moved our docker images to the Amazon Container Registry (ECR). To access ECR in docker you need to install and configure the amazon-ecr-credential-helper
. This post contains a short writeup on the necessary steps.
Installation
$ apt update
$ apt install amazon-ecr-credential-helper
Configuration
Set the AWS credentials:
$ mkdir ~/.aws
$ nano ~/.aws/credentials
[default]
aws_access_key_id=ABCDEFGABCDEFG
aws_secret_access_key=abcdefgabcdefgabcdefgabcdefg
Set the AWS default options (yours might be different):
$ nano ~/.aws/config
[default]
region=eu-north-1
output=json
Update the docker configuration (replace 1234567890
with your registry id):
$ nano ~/.docker/config.json
{
"credHelpers": {
"1234567890.dkr.ecr.eu-north-1.amazonaws.com": "ecr-login"
},
"credsStore": "ecr-login"
}