How docker container can talk to non docker VM

I have application which is docker container…I want it to talk to non-docker VM.
How can I do that ?
Both are in the same subnet.so both can ping each other.

You post does not provide enough information. Chances are low that you will receive help unless you provide more details.

What did you do exactly that didn’t work?

I have one application that runs on docker… Another application resides on VM.
I want this first application to send data to application on VM.

I know docker swarm and another n/w thing use to communicate to other docker container
by creating private n/w.

So I would like to know if above both VMs are in same ip range…Can application which runs
on docker easily talk with application on VM…

If so what steps are needed? How docker can reach to another application which is on VM

Docker Swarm is for orchestration, replication and high availability. Ability to create a private network is a byproduct.

Are you able to ping the VM’s IP from container attached shell?

Yes.I am able to ping ip of another VM’s IP from docker contaier shell…Please not the VM I want to comunicate is another VM and not the One where docker is runnig.