1+ FROM jupyter/scipy-notebook:latest
2+
3+ # Install .NET CLI dependencies
4+
5+ ARG NB_USER=jovyan
6+ ARG NB_UID=1000
7+ ENV USER ${NB_USER}
8+ ENV NB_UID ${NB_UID}
9+ ENV HOME /home/${NB_USER}
10+
11+ WORKDIR ${HOME}
12+
13+ USER root
14+ RUN apt-get update
15+ RUN apt-get install -y curl
16+
17+ # Install .NET CLI dependencies
18+ RUN apt-get install -y --no-install-recommends \
19+ libc6 \
20+ libgcc1 \
21+ libgssapi-krb5-2 \
22+ libicu60 \
23+ libssl1.1 \
24+ libstdc++6 \
25+ zlib1g
26+
27+ RUN rm -rf /var/lib/apt/lists/*
28+
29+ # Install .NET Core SDK
30+ ENV DOTNET_SDK_VERSION 3.1.101
31+
32+ RUN curl -SL --output dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
33+ && dotnet_sha512='eeee75323be762c329176d5856ec2ecfd16f06607965614df006730ed648a5b5d12ac7fd1942fe37cfc97e3013e796ef278e7c7bc4f32b8680585c4884a8a6a1' \
34+ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
35+ && mkdir -p /usr/share/dotnet \
36+ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
37+ && rm dotnet.tar.gz \
38+ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
39+
40+ # Enable detection of running in a container
41+ ENV DOTNET_RUNNING_IN_CONTAINER=true \
42+ # Enable correct mode for dotnet watch (only mode supported in a container)
43+ DOTNET_USE_POLLING_FILE_WATCHER=true \
44+ # Skip extraction of XML docs - generally not useful within an image/container - helps performance
45+ NUGET_XMLDOC_MODE=skip \
46+ # Opt out of telemetry until after we install jupyter when building the image, this prevents caching of machine id
47+ DOTNET_TRY_CLI_TELEMETRY_OPTOUT=true
48+
49+ # Trigger first run experience by running arbitrary cmd
50+ RUN dotnet help
51+
52+ # Copy notebooks
53+
54+ COPY ./notebooks/ ${HOME}/notebooks/
55+
56+ # Copy package sources
57+
58+ COPY ./nuget.config ${HOME}/nuget.config
59+
60+ RUN chown -R ${NB_UID} ${HOME}
61+ USER ${USER}
62+
63+ # Install nteract
64+ RUN pip install nteract_on_jupyter
65+
66+ # Install lastest build from master branch of Microsoft.DotNet.Interactive from myget
67+ RUN dotnet tool install -g Microsoft.dotnet-interactive --add-source "https://dotnet.myget.org/F/dotnet-try/api/v3/index.json"
68+
69+ # latest stable from nuget.org
70+ # RUN dotnet tool install -g Microsoft.dotnet-interactive --add-source "https://api.nuget.org/v3/index.json"
71+
72+ ENV PATH="${PATH}:${HOME}/.dotnet/tools"
73+ RUN echo "$PATH"
74+
75+ # Install kernel specs
76+ RUN dotnet interactive jupyter install
77+
78+ # Enable telemetry once we install jupyter for the image
79+ ENV DOTNET_TRY_CLI_TELEMETRY_OPTOUT=false
80+
81+ # Set root to notebooks
82+ WORKDIR ${HOME}/notebooks/
0 commit comments