首页 > 解决方案 > 无法从我的 Docker 容器 ping Windows 主机

问题描述

我在 Windows 2016 服务器上使用 Docker Desktop 运行 docker 容器。我在 Windows 2016 服务器上使用 Docker Desktop,而不是 Docker EE,因为我想运行 Linux 容器。Docker的详细信息如下:-

Docker 桌面版本是

版本 2.0.0.3 (31259) 频道:稳定

docker info 的输出如下: -

Containers: 3
Running: 1
Paused: 0
Stopped: 2
Images: 2
Server Version: 18.09.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec
init version: fec3683
Security Options:
seccomp
  Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: linuxkit-00155d2dab04
ID: OQK7:Z24A:V5KV:CYEW:6QQE:KXOB:UXWY:KVRF:QEHF:SATF:CTLU:WTPM
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 32
Goroutines: 53
System Time: 2020-02-26T06:36:51.0000459Z
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

docker版本的输出如下: -

Client: Docker Engine - Community
Version:           18.09.2
API version:       1.39
Go version:        go1.10.8
Git commit:        6247962
Built:             Sun Feb 10 04:12:31 2019
OS/Arch:           windows/amd64
Experimental:      false

Server: Docker Engine - Community
Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false

我无法从我的 Linux 容器 ping 我的 Windows 主机。

但这在我的 Windows 10 机器上是可能的。

这有什么我想念的线索???

标签: dockerdocker-desktop

解决方案


运行ifconfig并检查 docker0 接口的 IP。

并使用该IP ping。


推荐阅读