File tree Expand file tree Collapse file tree 2 files changed +26
-12
lines changed
Expand file tree Collapse file tree 2 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -3,18 +3,21 @@ FROM ubuntu:24.04
33# Set environment variables
44ENV CONDA_DIR=/opt/conda
55
6- # Install base tools and dependencies
7- RUN apt-get update && apt-get install -y \
8- openssh-server \
9- curl \
10- wget \
11- git \
12- vim \
13- build-essential \
14- python3 \
15- python3-pip \
16- python3-venv \
17- && rm -rf /var/lib/apt/lists/*
6+ # Install base tools and dependencies with retry mechanism and network optimization
7+ RUN apt-get clean && \
8+ apt-get update --fix-missing && \
9+ apt-get install -y --no-install-recommends \
10+ openssh-server \
11+ curl \
12+ wget \
13+ git \
14+ vim \
15+ build-essential \
16+ python3 \
17+ python3-pip \
18+ python3-venv \
19+ && rm -rf /var/lib/apt/lists/* \
20+ && apt-get clean
1821
1922# Create development user
2023ARG DEV_USER=linuxserver.io
@@ -36,6 +39,10 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$(if [ "$TA
3639# Set conda permissions
3740RUN chown -R $DEV_USER:$DEV_USER $CONDA_DIR
3841
42+ # Add conda to PATH and initialize
43+ ENV PATH="$CONDA_DIR/bin:$PATH"
44+ RUN conda init
45+
3946# Create .ssh directory
4047RUN mkdir -p /home/$DEV_USER/.ssh && \
4148 chown $DEV_USER:$DEV_USER /home/$DEV_USER/.ssh && \
Original file line number Diff line number Diff line change 2727 echo " ⚠️ Unable to connect to container via SSH"
2828fi
2929
30+ # Configure conda auto-activation for development user
31+ echo " Configuring conda auto-activation for user $DEV_USER ..."
32+ echo ' export PATH="/opt/conda/bin:$PATH"' >> " $USER_HOME /.bashrc"
33+ echo ' source /opt/conda/etc/profile.d/conda.sh' >> " $USER_HOME /.bashrc"
34+ echo ' conda activate base' >> " $USER_HOME /.bashrc"
35+ chown $DEV_USER :$DEV_USER " $USER_HOME /.bashrc"
36+
3037# Configure SSH timeout settings
3138echo " Configuring SSH timeout settings (60 minutes)..."
3239cat >> /etc/ssh/sshd_config << 'SSHD_EOF '
You can’t perform that action at this time.
0 commit comments