Skip to content

Commit 6d1f97c

Browse files
authored
Update Dockerfile
1 parent 4c63a4b commit 6d1f97c

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# - Package Manager: 'uv' (ultra-fast) and 'conda'
88
# - Optimization (China):
99
# - 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)
1111
# - Pre-installed Libraries: A minimal set (numpy, pandas, matplotlib)
1212
# - Convenience: Auto-activates conda environment in the terminal
1313
# ==============================================================================
@@ -63,15 +63,16 @@ RUN \
6363
# Create the configuration directory for uv.
6464
mkdir -p ~/.config/uv && \
6565
\
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 && \
7070
\
7171
# Create the default conda environment.
7272
conda create -n py${PYTHON_VERSION} python=${PYTHON_VERSION} -y && \
7373
\
7474
# Pre-install a minimal set of core data science libraries.
75+
# This command will now succeed as uv can correctly parse its config.
7576
uv pip install --python=${CONDA_DIR}/envs/py${PYTHON_VERSION}/bin/python \
7677
numpy \
7778
pandas \

0 commit comments

Comments
 (0)