Docker Community Forums

Share and learn in the Docker community.

Dotnet restore works manually but from docker container fives error

docker

(Azstate) #1

Dotnet restore works fine if run manually, gives error if I try to run via Dockerfile
I am using VS2017 Professional
Docker EE : Docker version 17.06.2-ee-6, build e75fdb8
Docker-compose : docker-compose version 1.19.0, build 9e633ef3

Dokerfile:
FROM microsoft/aspnetcore:1.1 AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/aspnetcore-build:1.1 AS build
WORKDIR /src
COPY *.sln ./
COPY FileUploader/FileUploader.csproj FileUploader/
RUN dotnet restore
COPY . .
WORKDIR /src/FileUploader
RUN dotnet build -c Release -o /app

FROM build AS publish
RUN dotnet publish -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT [“dotnet”, “FileUploader.dll”]