roll-ai commited on
Commit
443efba
·
verified ·
1 Parent(s): 76f7f2a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -10
Dockerfile CHANGED
@@ -1,10 +1,11 @@
1
  FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
2
  # Non-interactive APT installs
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  PATH=/opt/conda/bin:$PATH \
5
  CUDA_HOME=/usr/local/cuda
6
 
7
- # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  wget git build-essential \
10
  libgl1-mesa-glx libgl1-mesa-dri xvfb ffmpeg \
@@ -16,25 +17,31 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86
16
  rm /tmp/miniconda.sh && \
17
  conda clean -afy
18
 
19
- # Remove ALL Anaconda default channels to skip TOS prompt
20
- RUN conda config --remove channels defaults || true && \
21
- conda config --remove channels https://repo.anaconda.com/pkgs/main || true && \
22
- conda config --remove channels https://repo.anaconda.com/pkgs/r || true && \
 
 
23
  conda config --add channels conda-forge && \
24
  conda config --set channel_priority strict
25
 
26
- # Create environment from conda-forge only
27
- RUN conda create -n appenv python=3.10 ffmpeg=7 -y && conda clean -afy
 
 
 
 
28
  SHELL ["conda", "run", "-n", "appenv", "/bin/bash", "-c"]
29
 
30
- # Copy requirements first (for Docker layer caching)
31
  WORKDIR /workspace
32
  COPY requirements.txt .
33
 
34
- # Install Python dependencies (flash-attn compiles here)
35
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
36
 
37
- # Copy rest of project files
38
  COPY . .
39
 
40
  CMD ["conda", "run", "--no-capture-output", "-n", "appenv", "python", "finetune/app.py"]
 
1
  FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
2
  # Non-interactive APT installs
3
+ # Avoid any apt interactive prompts
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  PATH=/opt/conda/bin:$PATH \
6
  CUDA_HOME=/usr/local/cuda
7
 
8
+ # Install system packages
9
  RUN apt-get update && apt-get install -y \
10
  wget git build-essential \
11
  libgl1-mesa-glx libgl1-mesa-dri xvfb ffmpeg \
 
17
  rm /tmp/miniconda.sh && \
18
  conda clean -afy
19
 
20
+ # Remove ALL Anaconda default channels (system + user configs)
21
+ RUN rm -f /opt/conda/.condarc && \
22
+ conda config --system --remove-key channels || true && \
23
+ conda config --remove-key channels || true && \
24
+ conda config --system --add channels conda-forge && \
25
+ conda config --system --set channel_priority strict && \
26
  conda config --add channels conda-forge && \
27
  conda config --set channel_priority strict
28
 
29
+ # This prevents Conda from auto-adding defaults during env creation
30
+ ENV CONDA_FORGE=1 \
31
+ CONDA_AUTO_UPDATE_CONDA=false
32
+
33
+ # Create environment using ONLY conda-forge
34
+ RUN conda create --override-channels -n appenv -c conda-forge python=3.10 ffmpeg=7 -y && conda clean -afy
35
  SHELL ["conda", "run", "-n", "appenv", "/bin/bash", "-c"]
36
 
37
+ # Copy requirements
38
  WORKDIR /workspace
39
  COPY requirements.txt .
40
 
41
+ # Install pip dependencies
42
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
43
 
44
+ # Copy rest of code
45
  COPY . .
46
 
47
  CMD ["conda", "run", "--no-capture-output", "-n", "appenv", "python", "finetune/app.py"]