Closed geekodour closed 5 months ago
In nixos config, it would go file
plugin = {
docker."auth.helper" = "ecr-login";
};
Update: The above did not actually work, what worked in nixos+nomad for specifying plugin options is the following:
see (json parse) https://github.com/hashicorp/nomad/issues/7981
# ecr support for docker
# 1. IAM role to be assumed by ec2 instance
# 2. Needs docker-credential-ecr-login to be installed on the machine
# echo "<acc>.dkr.ecr.<region>.amazonaws.com/<repo>" | docker-credential-ecr-login get
# NOTE: If other public images start failing, we'd need to use "auth_soft_fail"
plugin = [{
docker = [{
config = [{
auth = [{
# NOTE: We're not specifying the config directly, so no
# additional handling of docker config is required
# NOTE: If we needed to use config, we'd do it something like:
# config = "/etc/docker/config.json";
helper = "ecr-login";
}];
}];
}];
}];
Hi @geekodour, thanks for filing an issue! I'm afraid the documentation is correct, though, plugin configuration must live within a config
block. Have a look at the configSpec structure to better understand how plugin config is parsed.
@pkazmierczak yes you're right, I've updated my previous comment to reflect the same. Apologies for the confusion!
@tgross ^ updated the comment with appropriate config that worked. Think it's an issue already being tracked.
https://developer.hashicorp.com/nomad/docs/v1.6.x/drivers/docker#authentication mentions the following
while as per https://github.com/hashicorp/nomad/blob/a3b1810bdbc2be395d2e4035dd8ce45e4b5ce33b/drivers/docker/config.go#L60-L63
it should be