I am trying to start my .net core web api on container tech. using docker.
Environments=Windows 10,Visual Studio
Docker version:
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:05:22 2017
OS/Arch: windows/amd64
Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:12:29 2017
OS/Arch: linux/amd64
Experimental: true
My Nuget.Config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json"
protocolVersion="3" />
<add key="Private"
value="http://My_Private_Nuget_Server" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="True" />
</packageManagement>
<apikeys>
<add key="https://www.nuget.org" value="Some_Long_Value" />
</apikeys>
<disabledPackageSources />
</configuration>
My Dockerfile:
FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "MailAlertWebApiWithEF.dll"]
I' am using Linux Container on windows 10 machine. I have .net core project on Visual Studio 17. When ı add docker support and run from VS 17 everything works fine. API stands up inside a container.But don't work when i close the VS. However When ı try to customize my dockerfile to make my image and container independent from VS. It gives error because of a private .dll
.
In my project ı have a .dll
from my private nuget server. When ı tried without my private .dll
ı can create image. But ı need that .dll
. Docker give me this error:
MailAlertWebApiWithEF.csproj : error NU1101: Unable to find package WebApi.Utils. No packages exist with this id in source(s): nuget.org
I searched this error. The source of problem seems like Nuget.Config file. But it seems good to me because i can see me private nuget server in there. When ı searched the solutions arrows always on linux machines but ı use windows.
1-)So if i can start my project with VS 17 , then my nuget.config file is in correct form. It can see my private nuget server. Right? Then why not docker don't see it?
Please help