我正在运行最新的Windows 10 Pro版本(1903),最新的Docker Engine版本(v19.03.8)和最新的IntelliJ(2019.3.4)。我已设置不带TLS的tcp://localhost:2375
上的公开守护进程并应用/重新启动引擎。尝试切换到Windows容器似乎挂了守护程序,并引发错误,此后,我需要销毁所有设置和配置文件,然后才能再次启动守护程序。
但是,当我尝试在Docker插件中设置tcp://localhost:2375
时,连接只是失败了(可能是超时,但是没有日志)。但是,只需使用CLI中的docker info
和其他命令即可按预期工作,因此我可以肯定Engine正在运行。供参考,docker info
的输出:
$ docker system info
Client:
Debug Mode: false
Plugins:
app: Docker Application (Docker Inc., v0.8.0)
buildx: Build with BuildKit (Docker Inc., v0.3.1-tp-docker)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.8
Storage Driver: overlay2
Backing Filesystem: <unknown>
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan 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: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.19.76-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.943GiB
Name: docker-desktop
ID: NGP3:BQCE:JSUO:6BSV:IUU6:2UEZ:4QTQ:N6IO:TA3T:A7I7:4GXS:IYD6
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 34
Goroutines: 50
System Time: 2020-03-27T15:56:23.690394533Z
EventsListeners: 3
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 Toolkit之外)来启动并运行集成?我什至如何测试连接可能断开的位置?
所以经过三天的研究,我得到了答案。显然,Windows 10保留了2344-2444的端口范围,这可以防止Docker守护进程actually暴露TCP套接字,尽管进行了设置。我感觉到它也与守护程序在重新启动后无法启动有关。您可以通过在提升的提示符/ powershell中执行以下操作来验证是否是问题的根本原因:netsh interface ipv4 show excludedportrange protocol=tcp
-如果输出显示的范围包括2375,则您受此影响,修复(这将包括两次重新启动!):
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
netsh int ipv4 add excludedportrange protocol=tcp startport=2375 numberofports=1
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All