Closed ThomasObenaus closed 5 years ago
This should be kind of expected since the AIM configures the credentials to use the AWS ECR.
The goal is to support also to pull from public repos like docker hub.
This can be done if docker is configured to use credHelper: ecr-login
instead of credStore: ecr-login
.
Doing this only for the docker pull calls against the concrete ecr url the ecr-login credential helper will be used.
For the calls against a public repo from docker hub no credential helper will be used and the pull call succeeds.
I tested it with:
{
"credHelpers": {
"<my_aws_accound_id>.dkr.ecr.us-east-1.amazonaws.com": "ecr-login"
}
}
It worked for:
docker pull <my_aws_accound_id>.dkr.ecr.us-east-1.amazonaws.com/ping-service
and docker pull thobe/ping_service:0.0.9
The only open question is: How to inject the correct aws account id into the /etc/docker/config.json
in an elegant way.
Mby using cloud-init/ user-data
Did you check if wildcards are supported? It might be possible to do something like this:
"*.awazonaws.com": "ecr-login
If wildcards are not supported, I would rather recommend to migrated docker hub images to ECR than to hand in the AWS account id. Furthermore doing a migration might reduce the versatility, but will increase the control about which images are used in the cluster.
Hint: There is a script which could easily be adapted to support docker hub as well.
Solved with #52
When trying to deploy a docker image from docker-hub nomad responds with the following error message:
Example job file: