首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法构建ASP.Net容器

无法构建ASP.Net容器
EN

Stack Overflow用户
提问于 2017-08-29 14:29:53
回答 1查看 454关注 0票数 2
代码语言:javascript
复制
Windows 10 version 1607
Docker for Windows: Version 17.06.1-ce-win24 (13025)

我试图使用.net构建asp 提供的文档 4.6容器,但它不起作用。

我在用这提供了dockerfile。我将其复制到我的asp .net解决方案的根目录中。

我执行了这个命令:

代码语言:javascript
复制
$ docker build -t aspnet-site --build-arg site_root=/

这是输出

代码语言:javascript
复制
PS> docker build -t aspnet-site . --build-arg 'site_root=/'
Sending build context to Docker daemon  326.1MB
Step 1/6 : FROM microsoft/dotnet-framework:4.6.2
4.6.2: Pulling from microsoft/dotnet-framework
3889bb8d808b: Pull complete
9f5eeabe6154: Pull complete
Digest: sha256:c281f2c09c9446f1896806933013a350f19db8f5a009e633ebd9701c470de35b
Status: Downloaded newer image for microsoft/dotnet-framework:4.6.2
 ---> be84290c2315
Step 2/6 : SHELL powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';
 ---> Running in 1fd036b1b56e
 ---> 413164f1a97c
Removing intermediate container 1fd036b1b56e
Step 3/6 : RUN Add-WindowsFeature Web-Server;     Add-WindowsFeature NET-Framework-45-ASPNET;     Add-WindowsFeature Web-Asp-Net45;     Remove-Item -Recurse C:\inetpub\wwwroot\*
 ---> Running in 4b0e5751281b

Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {Common HTTP Features, Default Documen...
True    No             Success        {ASP.NET 4.6}
True    No             Success        {Application Development, ASP.NET 4.6,...


 ---> 9afab6bfa836
Removing intermediate container 4b0e5751281b
Step 4/6 : ADD ServiceMonitor.exe /
ADD failed: GetFileAttributesEx \\?\C:\WINDOWS\TEMP\docker-builder455754487\ServiceMonitor.exe: The system cannot find the file specified.

因此,它确实在文档中这样写过(所以我试着注释掉了servicemonitor的内容,它起了作用):

不需要在Dockerfile中指定入口点,因为microsoft/aspnet基本映像已经包括监视发布服务(W3SVC)状态的入口点应用程序。

EN

回答 1

Stack Overflow用户

发布于 2017-08-29 14:42:05

尝试使用这个dockerfile代替。它将使用aspnet映像:

代码语言:javascript
复制
FROM microsoft/aspnet
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

EXPOSE 80

RUN Remove-WebSite -Name 'Default Web Site'  
RUN New-Website -Name 'YourSiteName' -Port 80 -PhysicalPath 'C:\YourFolderName' -ApplicationPool '.NET v4.5'

ADD "LocalFolderPath" /YourFolderName
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45941758

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档