|
7 | 7 | # - Package Manager: 'uv' (ultra-fast) and 'conda' |
8 | 8 | # - Optimization (China): |
9 | 9 | # - Timezone: Asia/Shanghai |
10 | | -# - PyPI Mirror: Alibaba Cloud (configured via uv.toml - BEST PRACTICE) |
| 10 | +# - PyPI Mirror: Alibaba Cloud (configured via uv.toml - CORRECT FORMAT) |
11 | 11 | # - Pre-installed Libraries: A minimal set (numpy, pandas, matplotlib) |
12 | 12 | # - Convenience: Auto-activates conda environment in the terminal |
13 | 13 | # ============================================================================== |
@@ -63,15 +63,16 @@ RUN \ |
63 | 63 | # Create the configuration directory for uv. |
64 | 64 | mkdir -p ~/.config/uv && \ |
65 | 65 | \ |
66 | | - ### --- [ THE DEFINITIVE FIX IS HERE ] --- ### |
67 | | - # Use 'printf' to create the uv.toml file. This is a single-line command |
68 | | - # from the shell's perspective and avoids all Docker parsing issues. |
69 | | - printf '[tool.uv]\nindex-url = "https://mirrors.aliyun.com/pypi/simple"\n' > ~/.config/uv/uv.toml && \ |
| 66 | + ### --- [ THE REAL, FINAL FIX IS HERE ] --- ### |
| 67 | + # Create the uv.toml with the CORRECT format for a global user config. |
| 68 | + # It does NOT use the [tool.uv] section header. |
| 69 | + printf 'index-url = "https://mirrors.aliyun.com/pypi/simple"\n' > ~/.config/uv/uv.toml && \ |
70 | 70 | \ |
71 | 71 | # Create the default conda environment. |
72 | 72 | conda create -n py${PYTHON_VERSION} python=${PYTHON_VERSION} -y && \ |
73 | 73 | \ |
74 | 74 | # Pre-install a minimal set of core data science libraries. |
| 75 | + # This command will now succeed as uv can correctly parse its config. |
75 | 76 | uv pip install --python=${CONDA_DIR}/envs/py${PYTHON_VERSION}/bin/python \ |
76 | 77 | numpy \ |
77 | 78 | pandas \ |
|
0 commit comments