我正在容器化我的 .Net + React.js 应用程序,但在此过程中我遇到了意外错误。我熟悉了类似的帖子,但没有一个解决方案能解决我的问题。由于构建日志很长,我已将其放入 Pastebin 中:
我使用的 dockerfile 来自官方文档,这就是为什么我惊讶地发现它不起作用:
https://learn.microsoft.com/en-us/visualstudio/containers/container-tools-react?view=vs-2022
Dockerfile 本身:
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1-mesa-glx
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1-mesa-glx
RUN curl -sL https://deb.nodesource.com/setup_14.x …Run Code Online (Sandbox Code Playgroud)