diff --git a/make/terminal/Dockerfile b/make/terminal/Dockerfile index 5f5a386c4..d0fe08ebf 100644 --- a/make/terminal/Dockerfile +++ b/make/terminal/Dockerfile @@ -3,18 +3,21 @@ FROM ubuntu:24.04 # Set environment variables ENV CONDA_DIR=/opt/conda -# Install base tools and dependencies -RUN apt-get update && apt-get install -y \ - openssh-server \ - curl \ - wget \ - git \ - vim \ - build-essential \ - python3 \ - python3-pip \ - python3-venv \ - && rm -rf /var/lib/apt/lists/* +# Install base tools and dependencies with retry mechanism and network optimization +RUN apt-get clean && \ + apt-get update --fix-missing && \ + apt-get install -y --no-install-recommends \ + openssh-server \ + curl \ + wget \ + git \ + vim \ + build-essential \ + python3 \ + python3-pip \ + python3-venv \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get clean # Create development user ARG DEV_USER=linuxserver.io @@ -36,6 +39,10 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$(if [ "$TA # Set conda permissions RUN chown -R $DEV_USER:$DEV_USER $CONDA_DIR +# Add conda to PATH and initialize +ENV PATH="$CONDA_DIR/bin:$PATH" +RUN conda init + # Create .ssh directory RUN mkdir -p /home/$DEV_USER/.ssh && \ chown $DEV_USER:$DEV_USER /home/$DEV_USER/.ssh && \ diff --git a/make/terminal/entrypoint.sh b/make/terminal/entrypoint.sh index 0584ea50e..cbb05dbf7 100644 --- a/make/terminal/entrypoint.sh +++ b/make/terminal/entrypoint.sh @@ -27,6 +27,13 @@ else echo "⚠️ Unable to connect to container via SSH" fi +# Configure conda auto-activation for development user +echo "Configuring conda auto-activation for user $DEV_USER..." +echo 'export PATH="/opt/conda/bin:$PATH"' >> "$USER_HOME/.bashrc" +echo 'source /opt/conda/etc/profile.d/conda.sh' >> "$USER_HOME/.bashrc" +echo 'conda activate base' >> "$USER_HOME/.bashrc" +chown $DEV_USER:$DEV_USER "$USER_HOME/.bashrc" + # Configure SSH timeout settings echo "Configuring SSH timeout settings (60 minutes)..." cat >> /etc/ssh/sshd_config << 'SSHD_EOF'