Skip to content

Instantly share code, notes, and snippets.

@andreslozadamosto
Last active October 28, 2020 17:20
Show Gist options
  • Save andreslozadamosto/bb0999d4cca4da0e746a8284c0c8b1e1 to your computer and use it in GitHub Desktop.
Save andreslozadamosto/bb0999d4cca4da0e746a8284c0c8b1e1 to your computer and use it in GitHub Desktop.
Jupyter Notebooks with net core c#
version: "3.8"
services:
web:
environment:
- JUPYTER_ENABLE_LAB=yes
build: .
volumes:
- type: bind
source: ./notebooks
target: /home/jovyan/work
ports:
- 8888:8888
tty: true
container_name: jupiterlab
FROM jupyter/minimal-notebook
#user
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
WORKDIR ${HOME}
USER root
# Update system
#RUN apt-get update && apt-get -y update
# Add netcore sources
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN sudo dpkg -i packages-microsoft-prod.deb
# Install netcore 3.1
RUN sudo apt-get update;
RUN sudo apt-get install -y apt-transport-https
RUN sudo apt-get update
RUN sudo apt-get install -y dotnet-sdk-3.1
# Enable detection of running in a container
ENV DOTNET_RUNNING_IN_CONTAINER=true \
DOTNET_USE_POLLING_FILE_WATCHER=true \
NUGET_XMLDOC_MODE=skip \
DOTNET_TRY_CLI_TELEMETRY_OPTOUT=true
# run first time
RUN dotnet help
# nuget configuration
COPY ./NuGet.config ${HOME}/nuget.config
# user
RUN chown -R ${NB_UID} ${HOME}
USER ${USER}
# Install dotnet interactive tool
RUN dotnet tool install -g Microsoft.dotnet-interactive --add-source "https://dotnet.myget.org/F/dotnet-try/api/v3/index.json"
# Dotnet tools to path
ENV PATH="${PATH}:${HOME}/.dotnet/tools"
RUN echo "$PATH"
# Install dotnet kernel for Jupyter
RUN dotnet interactive jupyter install
# dotnet telemetry
ENV DOTNET_TRY_CLI_TELEMETRY_OPTOUT=false
# Update conda version
#RUN conda update conda
#RUN conda update conda-build
# update conda plugins
#RUN conda update --all
WORKDIR ${HOME}/work
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-fsharp" value="https://dotnet.myget.org/F/fsharp/api/v3/index.json" />
<add key="dotnet-try" value="https://dotnet.myget.org/F/dotnet-try/api/v3/index.json" />
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
<add key="dotnet-corefxlab" value="https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
<add key="MachineLearning" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json" />
</packageSources>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment