Skip to content

Commit b241b61

Browse files
authored
Merge pull request #831 from kMutagene/main
Update Dockerfile
2 parents 82fe8e6 + cb2f182 commit b241b61

File tree

1 file changed

+15
-71
lines changed

1 file changed

+15
-71
lines changed

docs/Dockerfile

Lines changed: 15 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,29 @@
1-
FROM jupyter/base-notebook:latest
1+
FROM mcr.microsoft.com/dotnet/sdk:7.0
22

3-
# Install .NET CLI dependencies
3+
RUN apt-get update \
4+
&& apt-get -y upgrade \
5+
&& apt-get -y install python3 python3-pip python3-dev ipython3
6+
7+
RUN python3 -m pip install --no-cache-dir notebook jupyterlab
48

59
ARG NB_USER=fsdocs-user
610
ARG NB_UID=1000
711
ENV USER ${NB_USER}
812
ENV NB_UID ${NB_UID}
913
ENV HOME /home/${NB_USER}
1014

11-
WORKDIR ${HOME}
15+
RUN adduser --disabled-password \
16+
--gecos "Default user" \
17+
--uid ${NB_UID} \
18+
${NB_USER}
1219

20+
COPY . ${HOME}
1321
USER root
14-
RUN apt-get update
15-
RUN apt-get install -y curl
16-
17-
ENV \
18-
# Enable detection of running in a container
19-
DOTNET_RUNNING_IN_CONTAINER=true \
20-
# Enable correct mode for dotnet watch (only mode supported in a container)
21-
DOTNET_USE_POLLING_FILE_WATCHER=true \
22-
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
23-
NUGET_XMLDOC_MODE=skip \
24-
# Opt out of telemetry until after we install jupyter when building the image, this prevents caching of machine id
25-
DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT=true
26-
27-
# Install .NET CLI dependencies
28-
RUN apt-get update \
29-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
30-
libc6 \
31-
libgcc1 \
32-
libgssapi-krb5-2 \
33-
libicu66 \
34-
libssl1.1 \
35-
libstdc++6 \
36-
zlib1g \
37-
&& rm -rf /var/lib/apt/lists/*
38-
39-
# Install .NET Core SDK
40-
41-
# When updating the SDK version, the sha512 value a few lines down must also be updated.
42-
ENV DOTNET_SDK_VERSION 5.0.101
43-
44-
RUN dotnet_sdk_version=5.0.101 \
45-
&& curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz \
46-
&& dotnet_sha512='398d88099d765b8f5b920a3a2607c2d2d8a946786c1a3e51e73af1e663f0ee770b2b624a630b1bec1ceed43628ea8bc97963ba6c870d42bec064bde1cd1c9edb' \
47-
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
48-
&& mkdir -p /usr/share/dotnet \
49-
&& tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \
50-
&& rm dotnet.tar.gz \
51-
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
52-
# Trigger first run experience by running arbitrary cmd
53-
&& dotnet help
54-
55-
# Copy notebooks
56-
57-
COPY ./ ${HOME}/notebooks/
58-
59-
# Copy package sources
60-
61-
COPY ./NuGet.config ${HOME}/nuget.config
62-
6322
RUN chown -R ${NB_UID} ${HOME}
64-
USER ${USER}
65-
66-
#Install nteract
67-
RUN pip install nteract_on_jupyter
68-
69-
# Install lastest build from master branch of Microsoft.DotNet.Interactive
70-
RUN dotnet tool install -g Microsoft.dotnet-interactive --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"
71-
72-
#latest stable from nuget.org
73-
#RUN dotnet tool install -g Microsoft.dotnet-interactive --add-source "https://api.nuget.org/v3/index.json"
74-
75-
ENV PATH="${PATH}:${HOME}/.dotnet/tools"
76-
RUN echo "$PATH"
23+
USER ${NB_USER}
7724

78-
# Install kernel specs
79-
RUN dotnet interactive jupyter install
25+
ENV PATH="${PATH}:$HOME/.dotnet/tools/"
8026

81-
# Enable telemetry once we install jupyter for the image
82-
ENV DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT=false
27+
RUN dotnet tool install --global Microsoft.dotnet-interactive --version 1.0.410202
8328

84-
# Set root to notebooks
85-
WORKDIR ${HOME}/notebooks/
29+
RUN dotnet-interactive jupyter install

0 commit comments

Comments
 (0)