Windows上的Docker Linux容器-无法确定链接层地址/使用非规范名称拒绝访问文件

如何解决Windows上的Docker Linux容器-无法确定链接层地址/使用非规范名称拒绝访问文件

问题:

在Windows 10的Docker for Desktop的Linux容器中的Linux容器中运行简单的Web服务应用程序时,该服务无法从同一网络上的外部数据库中提取数据。在Docker Desktop的Windows容器中运行的同一项目可以正常工作。

Dev机: Windows 10-版本10.0.19041内部版本19041
Docker for Desktop 2.3.0.5(稳定)
在Docker桌面中打开Linux容器
(尝试使用HyperV-DockerDesktopVM和带有Ubuntu的WSL2)
Visual Studio 2019建立Docker撰写档案
VPN已连接到SQLserver所在的网络

当尝试通过Edge浏览器访问http:// localhost:32768 / api / dog / 2时,我只是“正在等待...。”什么都没有加载。.

我在此行的控制器上设置了一个断点:

var dog = await _context.dog.FindAsync(id);

并尝试进入该数据库或捕获连接数据库的异常,但永远不会产生异常。网站被困在尝试连接...

C:\Users\[user]\AppData\Local\Docker\log shows the following:

[20:31:37.685][VpnKit            ][Warning] vpnkit.exe: ARP table has no entry for 172.20.0.2<br/>
[20:31:37.685][VpnKit            ][Info   ] vpnkit.exe: IP.output: could not determine link-layer address for local network (0.0.0.0/0) ip 172.20.0.2<br/>
[20:31:37.685][VpnKit            ][Warning] vpnkit.exe: Could not find 172.20.0.2 on the local network<br/>
[20:31:58.517][GoBackendProcess  ][Info   ] rejecting access to file using non-canonical name microsoft.codeanalysis.csharp.expressionevaluator.expressioncompiler.ni.dll (canonical name is Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.ni.dll)<br/>
[20:31:58.518][GoBackendProcess  ][Info   ] rejecting access to file using non-canonical name microsoft.codeanalysis.csharp.expressionevaluator.expressioncompiler.ni.dll (canonical name is Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.ni.dll)<br/><br/>
....edited for brevity...lots of these rejecting access messages<br/><br/>
[20:32:30.931][VpnKit            ][Warning] vpnkit.exe: ARP table has no entry for 172.20.0.2
[20:32:30.931][VpnKit            ][Info   ] vpnkit.exe: IP.output: could not determine link-layer address for local network (0.0.0.0/0) ip 172.20.0.2
[20:32:30.931][VpnKit            ][Warning] vpnkit.exe: Could not find 172.20.0.2 on the local network
[20:32:30.931][VpnKit            ][Warning] vpnkit.exe: Error sending TCP packet via IP: no route to destination: no response for IP on local network

172.20.0.2是Docker容器的IPv4Address。

192.168.65是在Docker桌面的Docker资源设置中定义的子网。

一段时间后,它会出现在日志中:

1:20.846][VpnKit            ][Warning] vpnkit.exe: TCP 192.168.65.3:40000 > [IP of external sqlserver]:1433 closing flow due to idle port disconnection<br/>
[20:41:20.851][VpnKit            ][Warning] vpnkit.exe: TCP 192.168.65.3:39990 > [IP of external sqlserver]:1433 closing flow due to idle port disconnection<br/>
[20:41:20.852][VpnKit            ][Warning] vpnkit.exe: TCP 192.168.65.3:39964 > [IP of external sqlserver]:1433 closing flow due to idle port disconnection<br/>

使用wireshark,我可以看到到外部SQL Server的UDP和返回的ACK,并且可以从运行应连接到它的应用程序的容器中对SQLserver进行ping操作。但是娜达永远不会有数据返回到控制器。

无论是否使用Ubuntu运行HyperV VM或WSL2,我都会得到相同的结果。

我使用Docker Compose构建了这个项目,但是对于Windows,将Docker切换到Desktop到Windows Containers,我很高兴。来回简单地发生,我就在浏览器中获取数据。

有人知道我可能在这里缺少什么,或者在我的实现中配置错误吗?很高兴提供更多日志/代码示例。

更新

这似乎表明docker与我们正在使用的SQLserver不兼容。它很旧,当从Linux Container进行连接尝试时,我在事件查看器中看到SCHANNEL致命错误。但是,一切都可以在Windows容器中进行。

“从远程客户端应用程序收到了TLS 1.2连接请求,但是服务器不支持该客户端应用程序支持的所有密码套件。SSL连接请求失败。

已生成致命警报,并将其发送到远程端点。这可能会导致连接终止。 TLS协议定义的致命错误代码为40。WindowsSChannel错误状态为1205。 “

还看到一条消息,说明我们的证书已过期。要对此进行更改并提供更新。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-