Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix NuGet.config files for docker images #1402

Merged
merged 4 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,24 @@ RUN dotnet_sdk_version=5.0.102 \
# Copy notebooks
COPY ./samples/notebooks/ ${HOME}/Notebooks/

# Copy package sources
COPY ./NuGet.config ${HOME}/nuget.config
# Add package sources
RUN echo "\
<configuration>\
<solution>\
<add key=\"disableSourceControlIntegration\" value=\"true\" />\
</solution>\
<packageSources>\
<clear />\
<add key=\"dotnet-public\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json\" />\
<add key=\"dotnet-eng\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json\" />\
<add key=\"dotnet-tools\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json\" />\
<add key=\"dotnet-libraries\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json\" />\
<add key=\"dotnet5\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json\" />\
<add key=\"MachineLearning\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json\" />\
</packageSources>\
<disabledPackageSources />\
</configuration>\
" > ${HOME}/NuGet.config

RUN chown -R ${NB_UID} ${HOME}
USER ${USER}
Expand Down
1 change: 0 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="MachineLearning" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json" />
<add key="Nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources />
</configuration>
9 changes: 1 addition & 8 deletions docs/CreateBinder.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,20 @@ If you want to share notebooks you have made using the .NET Jupyter kernel, one

* A GitHub repo and at least one notebook to share
* **Dockerfile** to create the Binder image
* A **Nuget.Config** file to provide package sources needed by your notebooks

You can use the Dockerfile and Nuget.Config files from the folder `samples/my binder` to get started.

### Setup instructions

The repo file structure should look something like this:

<img src ="https://user-images.githubusercontent.com/375556/67017073-19137180-f0f1-11e9-9744-b5f8ec532e32.png" width = "30%">

The Dockerfile will install the .NET SDK, then copy the notebooks and Nuget.config to the notebooks folder.
The Dockerfile will install the .NET SDK then copy the notebooks to the notebooks folder.

```docker
# Copy notebooks

COPY ./notebooks/ ${HOME}/notebooks/

# Copy package sources

COPY ./NuGet.config ${HOME}/nuget.config

RUN chown -R ${NB_UID} ${HOME}
USER ${USER}
```
Expand Down
1 change: 1 addition & 0 deletions samples/connect-wpf/NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<clear />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
Expand Down
20 changes: 18 additions & 2 deletions samples/my binder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,24 @@ RUN dotnet_sdk_version=5.0.102 \

COPY ./notebooks/ ${HOME}/notebooks/

# Copy package sources
COPY ./NuGet.config ${HOME}/nuget.config
# Add package sources
RUN echo "\
<configuration>\
<solution>\
<add key=\"disableSourceControlIntegration\" value=\"true\" />\
</solution>\
<packageSources>\
<clear />\
<add key=\"dotnet-public\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json\" />\
<add key=\"dotnet-eng\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json\" />\
<add key=\"dotnet-tools\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json\" />\
<add key=\"dotnet-libraries\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json\" />\
<add key=\"dotnet5\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json\" />\
<add key=\"MachineLearning\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json\" />\
</packageSources>\
<disabledPackageSources />\
</configuration>\
" > ${HOME}/NuGet.config

RUN chown -R ${NB_UID} ${HOME}
USER ${USER}
Expand Down
16 changes: 0 additions & 16 deletions samples/my binder/NuGet.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Assent" Version="1.7.0" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.32" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="Assent" Version="1.7.0" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.32" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
<PackageReference Include="Pocket.Disposable" Version="1.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.32" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
<PackageReference Include="pocketlogger.subscribe" Version="0.7.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.32" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.8" />
<PackageReference Include="pocketlogger.subscribe" Version="0.7.0">
<PrivateAssets>all</PrivateAssets>
Expand Down