11FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
2-
32ARG user_name
43ARG uid
54ARG gid
65ENV HOME=/root
7-
86WORKDIR ${HOME}
97
108ENV DEBIAN_FRONTEND=noninteractive
@@ -17,12 +15,25 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
1715 && apt-get clean \
1816 && apt-get update
1917
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+
2031# Create a non-root user
2132RUN mkdir /app /logs /data
2233RUN groupadd -g ${gid} ${user_name} \
2334 && useradd -m -u ${uid} -g ${gid} ${user_name} \
2435 && chown -R ${uid}:${gid} /home
25- #
36+
2637# Switch to the new user and set home directory as working directory
2738USER ${user_name}
2839ENV HOME=/home/${user_name}
@@ -36,18 +47,7 @@ RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master
3647
3748RUN echo "export PATH=$PATH:/home/${user_name}/.local/bin" >> /home/${user_name}/.zshrc
3849
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}
4950USER root
50- # ENV HOME=/root
5151WORKDIR /app
5252
5353CMD ["zsh" ]
0 commit comments