Spaces:
Sleeping
Sleeping
tiffank1802 commited on
Commit ·
7b36781
1
Parent(s): 09c4d3b
Fix conda ToS: explicitly remove all default channels and use --override-channels
Browse files- Dockerfile +12 -9
Dockerfile
CHANGED
|
@@ -12,20 +12,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 12 |
bash \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
# Install
|
| 16 |
-
RUN wget https://
|
| 17 |
-
&& bash /tmp/
|
| 18 |
-
&& rm /tmp/
|
| 19 |
|
| 20 |
ENV PATH="/opt/conda/bin:${PATH}"
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
RUN conda config --remove channels defaults || true && \
|
|
|
|
|
|
|
| 24 |
conda config --add channels conda-forge && \
|
| 25 |
-
conda config --set channel_priority strict
|
|
|
|
| 26 |
|
| 27 |
-
# Install FEniCS via conda-forge
|
| 28 |
-
RUN conda install fenics-dolfinx mpich petsc4py -y && conda clean -afy
|
| 29 |
|
| 30 |
# Install Python dependencies (use conda's pip)
|
| 31 |
COPY requirements.txt .
|
|
|
|
| 12 |
bash \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
+
# Install Miniforge (conda-forge only, no ToS issues)
|
| 16 |
+
RUN wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O /tmp/miniforge.sh \
|
| 17 |
+
&& bash /tmp/miniforge.sh -b -p /opt/conda \
|
| 18 |
+
&& rm /tmp/miniforge.sh
|
| 19 |
|
| 20 |
ENV PATH="/opt/conda/bin:${PATH}"
|
| 21 |
|
| 22 |
+
# Remove ALL default channels and use ONLY conda-forge to avoid ToS issues
|
| 23 |
+
RUN conda config --remove channels defaults 2>/dev/null || true && \
|
| 24 |
+
conda config --remove channels https://repo.anaconda.com/pkgs/main 2>/dev/null || true && \
|
| 25 |
+
conda config --remove channels https://repo.anaconda.com/pkgs/r 2>/dev/null || true && \
|
| 26 |
conda config --add channels conda-forge && \
|
| 27 |
+
conda config --set channel_priority strict && \
|
| 28 |
+
conda config --show channels
|
| 29 |
|
| 30 |
+
# Install FEniCS via conda-forge ONLY
|
| 31 |
+
RUN conda install -c conda-forge --override-channels fenics-dolfinx mpich petsc4py -y && conda clean -afy
|
| 32 |
|
| 33 |
# Install Python dependencies (use conda's pip)
|
| 34 |
COPY requirements.txt .
|