How to communicate with docker container in weave?

what I have done:

[spdocker@codebrag02 ~]$ weave launch
[spdocker@codebrag02 ~]$ weave env
export DOCKER_HOST=unix:///var/run/weave/weave.sock ORIG_DOCKER_HOST=
[spdocker@codebrag02 ~]$ eval $(weave env)

[spdocker@codebrag02 ~]$ weave run -idt --name hostA ubuntu bash
19c1caf5e6ebc6e398ddae58d253b3352847cdb78fdb58d77717450f3b156a0a
[spdocker@codebrag02 ~]$ weave run -idt --name hostB ubuntu bash
c0508959453c2d1af83ea98e7361be004fa75962897536bbb842a25382bae002
[spdocker@codebrag02 ~]$ docker exec -it 19c bash
root@hostA:/# ping hostB
PING hostB.weave.local (10.32.0.3) 56(84) bytes of data.
64 bytes from hostB.weave.local (10.32.0.3): icmp_seq=1 ttl=64 time=0.096 ms
64 bytes from hostB.weave.local (10.32.0.3): icmp_seq=2 ttl=64 time=0.061 ms
64 bytes from hostB.weave.local (10.32.0.3): icmp_seq=3 ttl=64 time=0.075 ms
^C
--- hostB.weave.local ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.061/0.077/0.096/0.016 ms
root@hostA:/# [spdocker@codebrag02 ~]$ 
[spdocker@codebrag02 ~]$ ping hostA.weave.local
ping: unknown host hostA.weave.local
[spdocker@codebrag02 ~]$ ping hostB.weave.local
ping: unknown host hostB.weave.local
[spdocker@codebrag02 ~]$ 

I have start weave service, and start 2 docker container, hostA and hostB. HostA ping succeed to hostB, but can I ping hostA.weave.local from the DOCKER HOST ?

  • Connecting Docker Containers
  • docker notary : tls: oversized record received with length 20527
  • How to provide parameter to docker run with “oc new-app” in OpenShift?
  • Capturing Dockerfile variable in file
  • Java process in Docker container doesn't exit on end of main()
  • Extending an existing Docker Image on Docker Hub
  • Multi-Node Hadoop in kubernetes
  • Get containers running a given image version
  • Flocker: How do I provide a custom /etc/mongodb.conf file?
  • How to edit /etc/hosts file in running docker container
  • How can I pull a Docker image from a private Docker Hub repo remotely?
  • Docker logs retrieval from MongoDB
  • One Solution collect form web for “How to communicate with docker container in weave?”

    I think you are asking for the container hostname to resolve from the outer host. To make this happen, you need to change your host’s DNS resolver to point at Weave’s DNS resolver. You can see its address with weave dns-args (this is formatted for use in docker run, but it’s not too cryptic)

    Exactly how to modify your host’s DNS resolver depends on the OS of your host.

    There are some other nuances that may be important; could you say a bit more about what you are trying to achieve at a higher level?

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.