1+ FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
2+
3+ ARG user_name
4+ ARG uid
5+ ARG gid
6+ ENV HOME=/root
7+
8+ WORKDIR ${HOME}
9+
10+ ENV DEBIAN_FRONTEND=noninteractive
11+ RUN apt-get update -y && apt-get install -y --no-install-recommends \
12+ vim zsh tmux wget curl htop jupyter python3 python3-pip libgl1-mesa-glx git sudo ssh libglib2.0-0 \
13+ tree \
14+ && apt-get -y autoclean \
15+ && apt-get -y autoremove \
16+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
17+ && apt-get clean \
18+ && apt-get update
19+
20+ # Create a non-root user
21+ RUN mkdir /app /logs /data
22+ RUN groupadd -g ${gid} ${user_name} \
23+ && useradd -m -u ${uid} -g ${gid} ${user_name} \
24+ && chown -R ${uid}:${gid} /home
25+ #
26+ # Switch to the new user and set home directory as working directory
27+ USER ${user_name}
28+ ENV HOME=/home/${user_name}
29+ WORKDIR ${HOME}
30+
31+ # Install Oh My Zsh and plugins
32+ RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended \
33+ && git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
34+ && git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
35+ && sed -i 's/^plugins=(.*)$/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc
36+
37+ RUN echo "export PATH=$PATH:/home/${user_name}/.local/bin" >> /home/${user_name}/.zshrc
38+
39+ # install pip packages
40+ COPY ./conda/amadeusGPT.yml ${HOME}/amadeusGPT.yml
41+ SHELL ["/bin/bash" , "-lc" ]
42+ RUN source /opt/conda/etc/profile.d/conda.sh && \
43+ conda env create -f ${HOME}/amadeusGPT.yml && \
44+ conda activate amadeusgpt && \
45+ pip install --no-cache-dir --upgrade pip setuptools && \
46+ pip install --no-cache-dir gpustat nvitop pytest PySide6==6.3.1 streamlit networkx isort black git+https://github.com/DeepLabCut/DeepLabCut.git
47+
48+ # USER ${user_name}
49+ USER root
50+ # ENV HOME=/root
51+ WORKDIR /app
52+
53+ CMD ["zsh" ]
54+ SHELL ["/bin/zsh" , "-c" ]
0 commit comments