Hi Team,
I am getting error in (RUN dotnet restore "LatestCoreAppForDocker/LatestCoreAppForDocker.csproj") line while create image file using Power-shell script.
I am using below command to create image file.
PS C:\Abinash\Interview\Microservices\DockerASPAppication> docker build --tag tagone -f latestcoreappfordocker/dockerfile .
Below is my docker file.
--------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
I am getting error in (RUN dotnet restore "LatestCoreAppForDocker/LatestCoreAppForDocker.csproj") line while create image file using Power-shell script.
I am using below command to create image file.
PS C:\Abinash\Interview\Microservices\DockerASPAppication> docker build --tag tagone -f latestcoreappfordocker/dockerfile .
Below is my docker file.
--------------------------------------------------------------------------------------------------------------------
C#:
#See Visual Studio Container Tools build and debug overview - Visual Studio to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see Windows Container Version Compatibility
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-nanoserver-1809 AS base
WORKDIR /Abinash/Interview/Microservices/DockerASPAppication/LatestCoreAppForDocker
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1809 AS build
WORKDIR /src
COPY ["LatestCoreAppForDocker/LatestCoreAppForDocker.csproj", "LatestCoreAppForDocker/"]
RUN dotnet restore "LatestCoreAppForDocker/LatestCoreAppForDocker.csproj"
COPY . .
WORKDIR "/src/LatestCoreAppForDocker"
RUN dotnet build "LatestCoreAppForDocker.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "LatestCoreAppForDocker.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "LatestCoreAppForDocker.dll"]
Last edited by a moderator: