Skip to content

Instantly share code, notes, and snippets.

@dmohl
Created February 16, 2021 21:32
Show Gist options
  • Save dmohl/d09fc2704621c873c44129f2ad60a53d to your computer and use it in GitHub Desktop.
Save dmohl/d09fc2704621c873c44129f2ad60a53d to your computer and use it in GitHub Desktop.
.NET Interactive Dockerfile
# Specifies base image and tag
FROM gcr.io/deeplearning-platform-release/base-cpu:latest
ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# Opt out of telemetry until after we install jupyter when building the image, this prevents caching of machine id
DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT=true
# Installs .NET Interactive
RUN wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN apt-get update
RUN apt-get install -y dotnet-sdk-3.1
RUN dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-interactive --version 1.0.155302
ENV PATH="$PATH:~/.dotnet/tools"
RUN echo $PATH
RUN dotnet interactive jupyter install
# Enable telemetry once we install jupyter for the image
ENV DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT=false
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment