无法从我的Docker容器ping Windows主机计算机

时间:2020-02-26 07:07:50

标签: docker docker-desktop

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

Docker Desktop的版本为

版本2.0.0.3(31259) 频道:稳定

码头工人信息的输出如下:-

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计算机上是可能的。

这是我所缺少的任何线索吗?

1 个答案:

答案 0 :(得分:0)

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

然后使用该IP执行ping操作。