11# Base image with PyTorch and CUDA support
22FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
33
4- # User arguments for container setup
4+ # User arguments for container setup - keeping for compatibility with Makefile
55ARG user_name
66ARG uid
77ARG gid
@@ -15,18 +15,6 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
1515 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
1616 && apt-get clean
1717
18- # Create a non-root user
19- RUN mkdir -p /app /home/${user_name}
20- RUN groupadd -g ${gid} ${user_name} \
21- && useradd -m -u ${uid} -g ${gid} ${user_name} \
22- && chown -R ${uid}:${gid} /home/${user_name}
23-
24- # Switch to the new user and set home directory as working directory
25- USER ${user_name}
26- ENV HOME=/home/${user_name}
27- WORKDIR ${HOME}
28-
29- # Create a user conda environment to avoid permission issues
3018SHELL ["/bin/bash" , "-c" ]
3119RUN conda create -y --name amadeusGPT python=3.10
3220ENV PATH=/opt/conda/envs/amadeusGPT/bin:$PATH
@@ -36,9 +24,11 @@ RUN conda install -y -n amadeusGPT hdf5 pytables=3.8.0
3624RUN pip install --no-cache-dir notebook amadeusgpt
3725RUN pip install -U --pre deeplabcut
3826
39- # Initialize conda for the user's bash
27+ # Initialize conda for bash
4028RUN conda init bash
41- RUN echo 'conda activate amadeusGPT' >> ${HOME} /.bashrc
29+ RUN echo 'conda activate amadeusGPT' >> ~ /.bashrc
4230
31+ USER root
4332# Default command when container starts (activating the conda env)
33+ WORKDIR /app
4434CMD ["bash" , "-l" ]
0 commit comments