Hello, i have tried out the following after looking at the example you have shared:
Created a dockerfile for CONFD which just starts the confd server “/confd/bin/confd --foreground --conf confd.conf --addloadpath <>”
docker container using this docker image comes up and i am able to access the CONFD from HOST using CLI.
I have created the docker container on a docker network “trialnetwork”.
For the confd daemon , i have taken the example 10-c_transform . I have created a docker image which when started will just create a bash session. this will keep the container alive. i have used docker run command like below:
docker run --net naveennet -it --name confdhandler -d -p 5000:5000 --volume /home/naveen/confd-7.5.1/examples.confd/intro/10-c_transform:/confd/apps confdproc bash
Both the containers are running in the same network. And Docker inspect command on network also shows the name of both the containers.
root@naveen-VirtualBox:/home/naveen/confd-7.5.1/examples.confd/intro/10-c_transform/build# docker network inspect 9f879c83663b
[
{
"Name": "naveennet",
"Id": "9f879c83663b8027cfb809899492684c9d1510d38073421c3cc81180e0495f28",
"Created": "2021-06-17T11:33:10.446580286+05:30",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"8d0e94c83e3f45d7c7284334350fa752294f97289ad1e8617315e0a758552f42": {
"Name": "confdcontainer",
"EndpointID": "63fdec05c7e0e32820fd6c1d4beb9700a20c59bbf23fc9ba01a5bc32c8d31564",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
},
"9dd0c5be6900190f8b88bfa0fa55e77b539a312fbe84f5cfe0fa1b52188ff458": {
"Name": "confdhandler",
"EndpointID": "2ba05ddbcec29ae9238e96d08765ea34c766f1c229a7bf5cc27a15a76fdbdc2a",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
Then i access the 2nd container (confdhandler) using docker exec command. And in the container session i start the proc ./user-storage-trans-app
I get the same error:
**DEBUG Failed to connect to ConfD: Connection refused**
**Failed to load schemas from confd**
Please note: I am able to access the CONFD server running in the container from the host. I am seeing this issue only when i try to establish connections between confd daemon running a container with a confd server running in another container.
I am able to connect to the CONFD server from another container (confdhandler) by trying the below command:
/confd/bin/confd_cli --address=172.18.0.2 --port=4565 --user=admin
In the above command “172.18.0.2” is the ip address of the container running the confd server.
Do i need to change the daemon connect to the ip-address of the container running the CONFD server?
Or do i need to make the confd server into a service and use that for connecting from container with daemon?
Your inputs will be really very helpful.