Ubuntu上的Docker .Net Core应用程序不在localhost:8000中打开
我正在使用Ubuntu 16.04,我在Windows上有一个.Net Core的docker应用程序,并试图让它在Ubuntu上运行。 我有docker和.net核心运行没有错误。
当我运行“sudo docker-compose up”时,它运行服务器,正在监听“ http:// +:80” 。 但是我无法在浏览器中打开它。 在Windows上,我正在使用的每个人都可以在localhost:8000上加载它。
当我运行docker-compose时,这是我得到的:
sudo docker-compose up Starting webui Starting projects_api Starting profile_api Starting identity_api Attaching to projects_api, profile_api, webui, identity_api profile_api | Hosting environment: Development profile_api | Content root path: /app projects_api | Hosting environment: Development profile_api | Now listening on: http://+:80 projects_api | Content root path: /app profile_api | Application started. Press Ctrl+C to shut down. projects_api | Now listening on: http://+:80 projects_api | Application started. Press Ctrl+C to shut down. identity_api | info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0] identity_api | User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. identity_api | Hosting environment: Development identity_api | Content root path: /app identity_api | Now listening on: http://+:80 identity_api | Application started. Press Ctrl+C to shut down.
现在,我已经尝试了这些方法,但在Windows上,他们使用Powershell脚本来ping服务器。 但我不知道如何将PowerShell转换为bash。 我想也许如果我把它转换成bash我可以运行应用程序。 这是据说运行服务器的powershell脚本:
param( [string]$host_url = "http://localhost" ) @( "$host_url`:5001/api/health/ping", "$host_url`:5002/api/health/ping", "$host_url`:5003/api/health/ping", "$host_url`:5001/.well-known/openid-configuration" ) | ForEach-Object { Invoke-WebRequest -Uri $_ } | Select-Object StatusCode, StatusDescription, Content
当docker-compose up
运行时,它会默认查找两个文件docker-compose.yml
和docker-compose.override.yml
。 您docker-compose.yml
中docker-compose.yml
不指定任何映射,但是docker-compose.override.yml
在主机容器中具有映射到主机上的5000
到80
。 不知道你的同事如何在8080
上触及UI,除非他们已经绘制了不同的东西。
- Flask,Gunicorn,NGINX,Docker:configurationSERVER_NAME和proxy_pass的方法是什么?
- 当我用PM2 + Docker启动我的应用程序时,只需运行并退出
- 不能将参数添加到Dockerfile RUN命令
- dotnet docker / bin / sh:1:[dotnet ,:找不到
- 在ASP.NET Core中构builddocker:“没有这样的文件或目录”错误
- 当应用程序在具有aspnetcore的泊坞窗容器中退出时返回和错误代码
- docker中运行的邮件服务失败
- 使用Docker自定义Visual Studio运行configuration
- 单声道TLS1.2问题 – btls-cert-sync“命令未find”
- 部署.NET Core 1.1应用程序到Docker – 无法parsingCoreCLRpath
- 在Windows中为Docker创build镜像文件正被另一个进程使用错误