1
- FROM mcr.microsoft.com/dotnet/sdk:8.0.203
1
+ FROM alpine:3.17
2
2
3
- RUN apt install -y --no-install-recommends wget && \
4
- apt autoremove -y && \
5
- apt clean && \
6
- rm -rf /var/lib/apt/lists/*
3
+ # Instalar dependências
4
+ RUN apk add --update \
5
+ --no-cache \
6
+ icu-libs \
7
+ krb5-libs \
8
+ libgcc \
9
+ libintl \
10
+ libssl1.1 \
11
+ libstdc++ \
12
+ zlib \
13
+ wget \
14
+ ca-certificates \
15
+ bash \
16
+ python3 \
17
+ py3-pip \
18
+ gcc \
19
+ python3-dev \
20
+ musl-dev \
21
+ linux-headers
22
+
23
+ RUN pip3 install --no-cache-dir notebook
24
+
25
+ # Download e instalação do SDK do .NET
26
+ RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
27
+ chmod +x dotnet-install.sh && \
28
+ ./dotnet-install.sh --version latest --install-dir /usr/share/dotnet && \
29
+ rm dotnet-install.sh
30
+
31
+ # Adicionar o diretório de ferramentas do .NET ao PATH
32
+ ENV PATH="/usr/share/dotnet:$PATH"
7
33
8
34
# Set non-root user
9
35
ENV USER="user"
10
- RUN useradd -ms /bin/bash -u 1000 $USER
36
+ RUN adduser -D -u 1000 $USER
11
37
USER $USER
12
38
ENV HOME="/home/$USER"
13
39
WORKDIR $HOME
14
40
15
- # Install Anaconda
16
- # RUN wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh -O anaconda.sh
17
- RUN wget https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh -O anaconda.sh
18
- RUN chmod +x anaconda.sh
19
- RUN ./anaconda.sh -b -p $HOME/anaconda
20
- RUN rm ./anaconda.sh
21
- ENV PATH="/${HOME}/anaconda/bin:${PATH}"
22
-
23
- # Install .NET kernel
41
+ # Instalar .NET Interactive
24
42
RUN dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-interactive
25
- ENV PATH="/${HOME}/.dotnet/tools:${PATH}"
43
+
44
+ # Configurar variáveis de ambiente
26
45
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
46
+ ENV PATH="/home/$USER/.dotnet/tools:${PATH}"
47
+
48
+ # Alterar permissões do diretório .dotnet para o usuário não root
49
+ RUN chown -R $USER:$USER $HOME/.dotnet
50
+
51
+
52
+ # Instalar o kernel do .NET para o Jupyter
27
53
RUN dotnet interactive jupyter install
28
54
29
- # Run Jupyter Notebook
55
+ # Expor a porta 8888 para o Jupyter Notebook
30
56
EXPOSE 8888
31
- ENTRYPOINT ["jupyter" , "notebook" , "--no-browser" , "--ip=0.0.0.0" ]
57
+
58
+ CMD ["jupyter" , "notebook" , "--no-browser" , "--ip=0.0.0.0" ]
0 commit comments