docker 在window 10 专业版的安装 && .net core 在docker的部署

1.如果无法安装Hyper-V,八成是自己的杀毒软件给关了,我的是 电脑管家-启动项里面 给关掉了。

2.如果部署.net core 后 运行 报

An assembly specified in the application dependencies manifest (tesat.deps.json) was not found:
package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.1.1'
path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll',

找到源项目文件的.csproj文件,追加一个

<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>,

追加完应该是这个样子:

<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
</ItemGroup>

</Project>,重新发布问题解决。

3 . 如果部署成功,但是访问不到,报超时,

  是因为 Docker for Windows makes whatever is running on port 80 in the container (in this case, nginx) available on port 80 of localhost,

 

docker run -p 8010:80 --name w4ebsser1svers hellowebapp.57

后面的80 不可改变,只改前面的 主机访问接口,即可访问的到。

具体 安装参考这位大神:https://www.cnblogs.com/Leo_wl/p/5666669.html#_label4

转载于:https://www.cnblogs.com/fishyues/p/9299763.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值