Spaces:
Build error
Build error
Fix 'conda: not found' by moving global ENV PATH for Conda earlier in Dockerfile
Browse files- Dockerfile +7 -1
Dockerfile
CHANGED
|
@@ -25,7 +25,7 @@ RUN apt-get update -y && apt-get install -qqy \
|
|
| 25 |
&& rm -rf /var/lib/apt/lists/* \
|
| 26 |
&& git lfs install # Initialize LFS system-wide
|
| 27 |
|
| 28 |
-
# Install Miniconda
|
| 29 |
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
|
| 30 |
/bin/bash miniconda.sh -b -p $CONDA_DIR && \
|
| 31 |
rm miniconda.sh && \
|
|
@@ -35,7 +35,12 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86
|
|
| 35 |
conda config --set auto_activate_base false && \
|
| 36 |
conda config --add channels conda-forge
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
# Accept Conda Terms of Service for default channels.
|
|
|
|
| 39 |
RUN . $CONDA_DIR/etc/profile.d/conda.sh && \
|
| 40 |
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
|
| 41 |
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
|
|
@@ -44,6 +49,7 @@ RUN . $CONDA_DIR/etc/profile.d/conda.sh && \
|
|
| 44 |
COPY . /app
|
| 45 |
|
| 46 |
# Create the Conda environment named 'cosmos-predict1' using the provided YAML file.
|
|
|
|
| 47 |
RUN conda env create -f cosmos-predict1.yaml
|
| 48 |
|
| 49 |
# Set the default Conda environment to be activated and update PATH (for subsequent layers and runtime)
|
|
|
|
| 25 |
&& rm -rf /var/lib/apt/lists/* \
|
| 26 |
&& git lfs install # Initialize LFS system-wide
|
| 27 |
|
| 28 |
+
# Install Miniconda
|
| 29 |
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
|
| 30 |
/bin/bash miniconda.sh -b -p $CONDA_DIR && \
|
| 31 |
rm miniconda.sh && \
|
|
|
|
| 35 |
conda config --set auto_activate_base false && \
|
| 36 |
conda config --add channels conda-forge
|
| 37 |
|
| 38 |
+
# NEW: Set the global PATH for Conda's base environment immediately after installation.
|
| 39 |
+
# This ensures 'conda' command is available for subsequent RUN commands.
|
| 40 |
+
ENV PATH=$CONDA_DIR/bin:$PATH
|
| 41 |
+
|
| 42 |
# Accept Conda Terms of Service for default channels.
|
| 43 |
+
# Now 'conda' command should be found.
|
| 44 |
RUN . $CONDA_DIR/etc/profile.d/conda.sh && \
|
| 45 |
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
|
| 46 |
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
|
|
|
|
| 49 |
COPY . /app
|
| 50 |
|
| 51 |
# Create the Conda environment named 'cosmos-predict1' using the provided YAML file.
|
| 52 |
+
# Now 'conda' command should be found.
|
| 53 |
RUN conda env create -f cosmos-predict1.yaml
|
| 54 |
|
| 55 |
# Set the default Conda environment to be activated and update PATH (for subsequent layers and runtime)
|