gpt4 book ai didi

visual-studio - Angular 项目未在 docker 上使用 Visual Studio 2019 运行

转载 作者:行者123 更新时间:2023-12-02 00:53:36 24 4
gpt4 key购买 nike

我使用内置的 Angular 模板 (ASP.NET Core 3) 在 Visual Studio 2019 上创建了一个新的 Web 项目。

enter image description here

然后,我使用 Visual Studio 的向导添加了 docker 支持(右键单击项目名称 -> 添加 -> Docker 支持)。

enter image description here

当我使用 IIS Express 从 Visual Studio 启动项目时,该项目运行良好,但在使用 Docker 启动时出现以下错误:

enter image description here

enter image description here

我认为 docker 文件中缺少某些内容。这是我的内容:

enter image description here

最佳答案

对于这个错误,是由node引起的未安装在 mcr.microsoft.com/dotnet/core/aspnet:3.0-stretch-slim图像,尝试更改您的 dockerfile 以安装 node使用版本 10 或更高版本。

FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-stretch-slim AS base
# BEGIN MODIFICATION - Node is needed for development (but not production)
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install --assume-yes nodejs
# END MODIFICATION

WORKDIR /app
EXPOSE 80
EXPOSE 443

关于visual-studio - Angular 项目未在 docker 上使用 Visual Studio 2019 运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56044251/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com