asp.net - 将ASP.Net应用程序部署到Window Server Core容器

标签 asp.net powershell docker visual-studio-2017 windows-container

我在使用旧版asp.net Web应用程序手动构建和运行Windows Server核心容器时遇到问题。在Visual Studio中,我可以使用自动生成的dockerfile / yml文件运行容器。

我想使用dockerfile而不是Visual Studio进行docker build和docker run powershell命令。

这是当前的yml文件:

version: '3'

services:

  fulldotnetwebapplication:

    image: fulldotnetwebapplication

    build:

      context: .\FullDotNetWebApplication

      dockerfile: Dockerfile

这是当前的dockerfile:
FROM microsoft/aspnet:4.7.1-windowsservercore-ltsc2016

ARG source

WORKDIR /inetpub/wwwroot

COPY ${source:-obj/Docker/publish} .

假设我的ASP项目是FullDotNetWebApplication,它包含App_Data,Content,Controllers等文件夹以及Master / ASPX页面以及web / packages / config。

我为我的Dockerfile尝试了这个:
FROM microsoft/aspnet:4.7.1-windowsservercore-ltsc2016

WORKDIR /inetpub/wwwroot

COPY . . 

COPY ./bin ./bin

并收到此错误:
docker : COPY failed: GetFileAttributesEx \\?\C:\Windows\TEMP\docker-builder977521850\bin: The system cannot find the file specified.
At line:1 char:1
+ docker build -t fulldotnetwebapplication .
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (COPY failed: Ge...file specified.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

我的docker文件应如何将此应用程序从Powershell部署到IIS?我不明白魔术VS正在做什么以使它起作用?它是构建应用程序还是生成某种部署文件?我可以指出的任何示例或示例Dockerfile都会很棒。

最佳答案

关于asp.net - 将ASP.Net应用程序部署到Window Server Core容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48348696/

相关文章:

c# - 将列添加到数据库表后 Entity Framework 出现问题

c# - 为什么使用 ASP.NET 验证器进行验证?

function - 连接路径和文件

powershell - PowerShell get-childitem和get-content深入几个文件夹

postgresql - Postgres 不在 docker 中初始化数据库

docker - 我可以在虚拟机中运行 Docker 吗?

javascript - 检查函数是否在 Ajax 和 WebMethod 中返回任何数据

ASP.NET 到 SQL Server 2005,UPDATE smalldatetime 过程不起作用?

powershell - 如何从另一个模块中包含的被调用函数调用 PowerShell 模块范围来访问变量?

docker - 如何使用kubectl补丁更改kubernetes容器的端口?