0
我真的面對奇怪的行爲,當我嘗試運行在Linux操作系統我泊塢窗圖像 - 圖像中包含的.Net核心Web API項目運行碼頭工人形象造成隼異常
這裏是我的Program.cs
var host = new WebHostBuilder()
.UseKestrel().UseStartup<Startup>().Build();
host.Run();
我的碼頭工人,compose.yml文件
version: '2'
services:
server:
image: repo.testCompany.com:1443/testCompany:6
ports:
- "60000:60000"
hostname: ucp.${HOST_HOSTNAME}
restart: unless-stopped
的形象是建立和推動successfully.The問題就來當Web API的嘗試運行容器內的項目,並且運行時異常爲t hrown -
Unhandled Exception: System.AggregateException: One or more errors occurred.
(Error -99 EADDRNOTAVAIL address not available) --->
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error
-99 EADDRNOTAVAIL address not available
at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.Check(Int32
statusCode)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.tcp_bind(UvTcpHandle handle, SockAddr& addr, Int32 flags)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvTcpHandle.Bind(ServerAddress address)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.TcpListener.CreateListenSocket()
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Listener.<>c.<StartAsync>b__6_0(Object state)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.CreateServer(ServerAddress address)
at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[TContext](IHttpApplication`1 application)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host, CancellationToken token, String shutdownMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
at Exactor.XeroConnector.API.Program.Main(String[] args)
的主要問題是,錯誤不會重現我的本地機器上,但只有當圖像是建立並通過詹金斯上傳。 你能請別人提出建議嗎。
何你指定的主機和端口,在您的應用程序正在運行? –
我試圖添加 .UseUrls(「http:// *:60000」) 但錯誤仍然相同。 – NDym