Thanks for the quick reply James!
I set the variable, and the situation has improved marginally: I no longer get the same error, but now I get: "Unable to create Exec, error: cannot connect to Docker endpoint"
I assumed that like everything else I could use the container name instead of the id. But trying with the actual id has the same issue.
Here's the full json payload to register the check:
{
"id": "elophant_haproxy_1",
"name": "elophant-haproxy",
"address": "elophant_haproxy_1",
"port": 81,
"check": {
"id": "elophant_haproxy_1",
"name": "Container Local Health Check",
"docker_container_id": "349d188308d1c2766a49649f511a8b1031ed03e9e96fae19a98bf044b6984243",
"shell": "/bin/bash",
"script": "/usr/bin/health-check.sh",
"interval": "15s",
"timeout": "5s"
}
}
And the request on the container:
curl -X PUT -H "content-type:application/json" --data "<json from above>" ${CONSUL_CLIENT_ADDRESS}/v1/agent/service/register
The service registers fine, and the check too. Consul just can't call the script.
Are there further consul logs I can enable to see what's wrong, or a way to test the check locally? The consul client logs don't seem all that useful:
2016-02-26_04:13:10.68805 2016/02/26 04:13:10 [INFO] agent: Synced service 'elophant_haproxy_1'
2016-02-26_04:13:11.01571 2016/02/26 04:13:11 [INFO] agent: Synced service 'elophant_haproxy_2'
2016-02-26_04:16:22.26907 2016/02/26 04:16:22 [INFO] agent: Synced check 'service:elophant_haproxy_1'
2016-02-26_04:19:48.61722 2016/02/26 04:19:48 [INFO] agent: Synced check 'service:elophant_haproxy_2'