Docker Community Forums

Share and learn in the Docker community.

Container that is accessible like a vm


I have one Docker container and one Hyper-V VM. They need to be able to connect to each other. The container should basically behave like a regular VM while it is alive.

I put the VM into the DockerNAT virtual switch and gave it an IP address in the Docker range. They can’t see each other and I cannot reach the published ports of the container from the VM.

Could someone help me with that, please?

(A container is not a VM.)
If you start the VM using a virtual switch, the container can access it using the VM’s IP address.
If you publish a port from your container it is attached to the Docker host, so the VM should be able to reach it at this address and port.