I am using ASP.NET Core 3 with Angular and Docker Windows Container.
I followed as below:
I have created docker compose and docker file
Dockerfile
# escape=`
FROM mcr.microsoft.com/powershell:nanoserver-1903 AS downloadnodejs
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]
RUN Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing "https://nodejs.org/dist/v10.16.3/node-v10.16.3-win-x64.zip"; `
Expand-Archive nodejs.zip -DestinationPath C:\; `
Rename-Item "C:\node-v10.16.3-win-x64" c:\nodejs
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-nanoserver-1903 AS base
WORKDIR /app
EXPOSE 80
COPY --from=downloadnodejs C:\nodejs\ C:\Windows\system32\
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-nanoserver-1903 AS build
COPY --from=downloadnodejs C:\nodejs\ C:\Windows\system32\
WORKDIR /src
COPY ["HardwareResources/HardwareResources.csproj", "HardwareResources/"]
RUN dotnet restore "HardwareResources/HardwareResources.csproj"
COPY . .
WORKDIR "/src/HardwareResources"
RUN dotnet build "HardwareResources.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "HardwareResources.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "HardwareResources.dll"]
Docker-compose.yml
version: '3.4'
services:
hardwareresources:
image: ${DOCKER_REGISTRY-}hardwareresources
build:
context: .
dockerfile: HardwareResources\Dockerfile
I run Docker compose in VS2019 and I am getting error pop up message and it says:
Could you please advise how to resolve this issue?