Skip to content

Commit 865bca8

Browse files
committed
Add NuGet.config to sample Dockerfiles
1 parent 42c9008 commit 865bca8

6 files changed

Lines changed: 24 additions & 3 deletions

File tree

samples/aspnetapp/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/framework/sdk:4.8.1 AS build
22
WORKDIR /app
33

44
# copy csproj and restore as distinct layers
5-
COPY *.sln .
5+
COPY *.sln NuGet.config ./
66
COPY aspnetapp/*.csproj ./aspnetapp/
77
COPY aspnetapp/*.config ./aspnetapp/
88
RUN nuget restore

samples/aspnetapp/NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
6+
</packageSources>
7+
</configuration>

samples/aspnetmvcapp/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/framework/sdk:4.8.1 AS build
22
WORKDIR /app
33

44
# copy csproj and restore as distinct layers
5-
COPY *.sln .
5+
COPY *.sln NuGet.config ./
66
COPY aspnetmvcapp/*.csproj ./aspnetmvcapp/
77
COPY aspnetmvcapp/*.config ./aspnetmvcapp/
88
RUN nuget restore

samples/aspnetmvcapp/NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
6+
</packageSources>
7+
</configuration>

samples/dotnetapp/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/framework/sdk:4.8.1 AS build
22
WORKDIR /app
33

44
# copy csproj and restore as distinct layers
5-
COPY *.csproj .
5+
COPY NuGet.config *.csproj ./
66
RUN dotnet restore
77

88
# copy and build everything else

samples/dotnetapp/NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
6+
</packageSources>
7+
</configuration>

0 commit comments

Comments
 (0)