I have a set of containers that all interconnect on a weave network. Some may be located on my PC, others in e.g. the AWS cloud. This generally works fine, but I noticed a situation where a container fails to connect on a weave IP address.
Typically I start a new container with:
C=$(weave run 10.2.1.4/24 -ti myname/mycomponent -c 10.2.1.2)
where 10.2.1.2 is the address of a central component.
Each container contains a component that registers itself at a central component. It does this right away when it starts. However, sometimes it seems that weave has not set up the IP addressing for the new container yet, so the container fails to connect to the central component.
I tried "docker create ..." to create the new contrainer (without running it yet), then do a "weave attach 10.2.1.4/24 ...", followed by "docker start ...". But weave does not accept this.
The workaround I use now is to do a "sleep" for x seconds inside the container, before it connects to the central component. Obviously this is not the ideal solution, because it makes containers aware of their environment constraints.
I have a set of containers that all interconnect on a weave network. Some may be located on my PC, others in e.g. the AWS cloud. This generally works fine, but I noticed a situation where a container fails to connect on a weave IP address.
Typically I start a new container with: C=$(weave run 10.2.1.4/24 -ti myname/mycomponent -c 10.2.1.2)
where 10.2.1.2 is the address of a central component.
Each container contains a component that registers itself at a central component. It does this right away when it starts. However, sometimes it seems that weave has not set up the IP addressing for the new container yet, so the container fails to connect to the central component.
I tried "docker create ..." to create the new contrainer (without running it yet), then do a "weave attach 10.2.1.4/24 ...", followed by "docker start ...". But weave does not accept this.
The workaround I use now is to do a "sleep" for x seconds inside the container, before it connects to the central component. Obviously this is not the ideal solution, because it makes containers aware of their environment constraints.