File size: 1,836 Bytes
4c5eeff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04

# Install base utilities
RUN apt-get update \
    && apt-get install -y build-essential \
    && apt-get install -y wget git curl vim nano htop byobu zip unzip \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install Docker
RUN curl -fsSL https://get.docker.com | sh

# Install miniconda
ENV CONDA_DIR=/opt/conda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
    /bin/bash ~/miniconda.sh -b -p /opt/conda

# Put conda in path so we can use conda activate
ENV PATH=$CONDA_DIR/bin:$PATH

# Install jupyter 
RUN pip install jupyter ipykernel nvitop
RUN pip install conda-pack 

# Install zsh
RUN apt-get update && apt-get install -y zsh
RUN chsh -s /usr/bin/zsh
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh && y)"
# COPY zsh config
COPY ./.zshrc /root/.zshrc
SHELL [ "/bin/zsh" , "-c" ]
ENV ZSH_CUSTOM=/root/.oh-my-zsh/custom
RUN git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

# Install ssh
RUN apt-get update && apt-get install -y openssh-server
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN useradd -m -s /bin/bash developer
RUN echo 'developer:devserver123' | chpasswd
RUN service ssh start

# Install nettools
RUN apt install -y net-tools telnet traceroute

EXPOSE 22

WORKDIR /workspace

# RUN command
CMD [ "jupyter-notebook", "--no-browser", "--ip=0.0.0.0", "--port", "8080", "--allow-root", "--NotebookApp.token=devserver123" , "--notebook-dir=/workspace", "--NotebookApp.terminado_settings={'shell_command': ['/usr/bin/zsh']}"]