Open bernhara opened 5 years ago
Since this problem is locking me, I found a simple workaround: I generated a unique hostname for the time the container is run:
DOCKER_HOST=unix:///var/run/weave/weave.sock ORIG_DOCKERHOST= docker run -it --rm --name "a good container name" --hostname "name with generated uid suffix.weave.local"_ hello-world
On Scope, the container appears with the "the good container name"
What you expected to happen?
After a container hase gone (has been rm-ed), the DNS should no more show a valid hostname for this container
What happened?
I start the operation right after having started and "reset" weavenet.
I launch 8 containers simultaneously, using the basic "docker run" command.
While the containers are active, the weavenet internal DNS allocated valid addresses for the containers:
Once the the containers have terminated their job, I check that nothing remains. There are no more containers named "mlr_worker_xx":
But, when I check the weavenet DNS entries, some hostnames (not always the sames) remain:
The hosts mlrworker should have been removed as the container has gone.
I made exactly the same test with weavenet version V 4.2.1, and all hostnames disappear as soon as the containers are gone.
Consequence of this bug:
When I restart a container with the same name, a second DNS entry is allocated for the new instance, but the DNS resolve inside the running container returns the first allocated address (indeed false).
In my case this leads to a socket hangup while trying to connect.
How to reproduce it?
Anything else we need to know?
Versions:
Logs:
or, if using Kubernetes:
Network: