Tag: .net core

无法构build在Docker中引用PCL的ASP.NET Core应用程序

我正在尝试使用以下Dockerfile构build一个ASP.NET Core docker镜像: FROM microsoft/aspnetcore-build:1.1.1 WORKDIR /app COPY src . RUN dotnet restore RUN dotnet publish –output /out/ –configuration Release EXPOSE 5000 ENTRYPOINT ["dotnet","/out/MyWebApp.dll"] 生成失败,并提供以下错误: /app/MyPCL/MyPCL.csproj(70,3):错误MSB4019:导入的项目“/usr/share/dotnet/sdk/1.0.1/Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets”没find。 确认声明中的path是正确的,并且该文件存在于磁盘上。 所以在构buildPCL库时遇到了问题,因为找不到Microsoft.Portable.CSharp.targets。 我的PCL项目文件具有以下导入语句: <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> 我正在考虑导致这个问题,因为这个path不能存在于docker集装箱中。 顺便说一句,该项目在Visual Studio 2017中build立和运行完美。 有任何想法吗?

Identity Server 4和Docker

我试图configurationDocker的IdentityServer4,但我不能让它的工作。 为了开始,我使用了身份服务器文档的Client Credential示例: 使用Client Credentials保护API IdentityServer 托pipe在5000端口上 的WebAPI 托pipe在港口5001 在我的WebApi的Startup.cs文件的Configure方法中,我做了以下操作(问题可能在这里): app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions { Authority = "http://web:5000", RequireHttpsMetadata = false, ApiName = "api1" }); 客户 和客户 // Everything is fine here… var disco = await DiscoveryClient.GetAsync("http://localhost:5000"); var tokenClient = new TokenClient(disco.TokenEndpoint, "client", "secret"); var tokenResponse = await tokenClient.RequestClientCredentialsAsync("api"); // This does not work var client = […]

在Docker中运行.Net Core 2.0上的IdentityServer4 – 访问主机资源

我试图将一个.Net Core 2.0应用程序的服务(IdentityServer 4 v2)转换为在Docker for Windows上运行。 这只在开发工作站上。 我做了标准的Visual Studio 2017“添加Docker支持”到现有的Net Core 2.0服务。 服务启动正常,但由于这些问题而失败: 该服务正在寻找安装在本地主机上的证书。 在Docker中运行它没有看到这个证书。 该服务使用主机的etc / host文件来查找我们的数据库服务器的DNS。 在Docker上运行的服务没有看到主机的DNS。 我试图将docker中的network_mode设置为“host”,但无法构build。 build立这样一个环境的build议方式是什么? 运行时是使用docker撰写的,默认的撰写和configuration非常简单: version: '3' services: identity.server: image: identity.server ports: – "8100:8100" build: context: ./src/Identity.Server dockerfile: Dockerfile 引用的dockerfile: FROM microsoft/dotnet:2.0-runtime ARG source WORKDIR /app COPY ${source:-obj/Docker/publish} . ENTRYPOINT ["dotnet", "Identity.Server.dll"] 我已经阅读了下面的答案,但它似乎不工作在.net本身: https : //devops.stackexchange.com/questions/1501/configure-docker-to-use-ssl-for-a-private -registry上-窗口10?newreg […]