hmalphettes / docker-route53-dyndns

Automated DynDNS for Docker containers using docker-gen and Route53
11 stars 10 forks source link

Error running notify command with private zone #1

Open yannispanousis opened 9 years ago

yannispanousis commented 9 years ago

Hi,

I'm trying to register my containers to a private zone but am receiving a cryptic error and not sure what the problem is:

$ docker run --rm --name route53 -v /var/run/docker.sock:/tmp/docker.sock -v /root/.aws:/root/.aws -e PUBLIC_IP=$(hostname -i) -e DRY_ROUTE53=true -e PRIVATE_TOP_ZONES=staging.aws -t hmalphettes/docker-route53-dyndns /usr/local/bin/docker-gen -watch -notify "/bin/sh -x /tmp/cli53routes" /app/cli53routes.tmpl /tmp/cli53routes
2015/08/26 21:03:00 Generated '/tmp/cli53routes' from 3 containers
2015/08/26 21:03:00 Running '/bin/sh -x /tmp/cli53routes'
2015/08/26 21:03:00 Error running notify command: /bin/sh -x /tmp/cli53routes, exit status 1
2015/08/26 21:03:00 + [ -z 10.1.20.102 ]
+ [ -z 10.1.20.102 -o not found = 10.1.20.102 ]
+ [ -z staging.aws ]
2015/08/26 21:03:00 Watching docker events

Please note that only 1 of my containers has VIRTUAL_HOST variable set and it is set to VIRTUAL_HOST=amqp.staging.aws

I also get the same error without the dry run option.

Thanks for your help!

Yannis

yannispanousis commented 9 years ago

Actually it seems the above error was simply because the last command was returning non-zero code and there are no containers which were added to the template.

Could you tell me what's wrong with my configuration and no containers get detected? If I restart a container I can see that the event is detected but the route53 script does not change.

Thanks!

Yannis

hmalphettes commented 8 years ago

Hi Yannis, sorry for the delay on this issue. I think my script from a few years ago is using a confusing env variable : PRIVATE_TOP_ZONES. It is not related to Route53's private zones. It is purely a way to skip registration of some VIRTUAL_HOST on this module.

So this should work:

docker run --rm --name route53 -v /var/run/docker.sock:/tmp/docker.sock -v /root/.aws:/root/.aws -e PUBLIC_IP=$(hostname -i) -e DRY_ROUTE53=true -t hmalphettes/docker-route53-dyndns

Does this help?

It is already 2 months since you raised the issue so if you have moved on already let us know.