如何从Docker容器访问Hyper-V上的实例

时间:2019-04-25 13:46:49

标签: docker

这是环境详细信息

On my laptop - Windows 10. I have Hyper V.
In Hyper V - I have Windows 2016 Instance.
The instance has IP address: 172.17.47.54
ipconfig on that VM gives:
Connection-specific DNS Suffix  . : mshome.net
Link-local IPv6 Address . . . . . : fe80::6810:b5de:2697:51a6%4
IPv4 Address. . . . . . . . . . . : 172.17.47.54
Subnet Mask . . . . . . . . . . . : 255.255.255.240
Default Gateway . . . . . . . . . : 172.17.47.49

在同一台笔记本电脑中,我有Docker容器。

要求:

From one of the docker container i want to connect to the 2016 VM on Hyper-V
Currently when i Ping from this docker container 
with Ping 172.17.47.54 i get host unreachable.

This container has registered itself with 'bridge' network on docker
The settings goes like this: 
> docker network inspect bridge
[
    {
        "Name": "bridge",
        "Id": "30437685f7208e4f3645ba23347fb9af8293daa487dadde5db9c3b3825e530a1",
        "Created": "2019-04-24T07:13:15.2483895Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "c01410e78c27ef23b9cb5c0313a24259110021dca3d843dfef476f2b98d1d9f9": {
                "Name": "rdpguacd",
                "EndpointID": "8825e8e84aaba2007452232024578249be96243af70832934085d24fb4a7f005",
                "MacAddress": "02:42:ac:11:00:03",
                "IPv4Address": "172.17.0.3/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

我浏览了不同的文档。我还没有找到可以帮助我实现这一目标的具体方法。

我需要知道需要做些什么才能使这种交流发生。这是为了确保可以从Docker容器访问2016 VM。

0 个答案:

没有答案