Skip to content

Commit 11a6cdc

Browse files
authored
Merge pull request #20 from sisgha/SSGDHA-132-Criar-imagem-Docker-do-jupyter-notebook
Criar imagem docker do jupyter notebook
2 parents d4b80f5 + 01adf56 commit 11a6cdc

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

playground/.devops/Dockerfile

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,58 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:8.0.203
1+
FROM alpine:3.17
22

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"
733

834
# Set non-root user
935
ENV USER="user"
10-
RUN useradd -ms /bin/bash -u 1000 $USER
36+
RUN adduser -D -u 1000 $USER
1137
USER $USER
1238
ENV HOME="/home/$USER"
1339
WORKDIR $HOME
1440

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
2442
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
2645
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
2753
RUN dotnet interactive jupyter install
2854

29-
# Run Jupyter Notebook
55+
# Expor a porta 8888 para o Jupyter Notebook
3056
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"]

playground/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
start:
2-
docker compose up lab -d;
2+
docker compose up lab -d --build;
33

44
stop:
55
docker compose down -v;

0 commit comments

Comments
 (0)