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