Skip to content

Commit eef3340

Browse files
authored
Update Dockerfile
1 parent f04c623 commit eef3340

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
# ==============================================================================
2121

2222
# --- Build Stage ---
23-
FROM codercom/code-server:latest as builder
23+
# FIX: Use uppercase 'AS' for better style consistency.
24+
FROM codercom/code-server:latest AS builder
2425

2526
# Set arguments for tool versions.
2627
ARG MINIFORGE_VERSION=23.11.0-0
2728
ARG PYTHON_VERSION=3.11
2829

2930
# Define global environment variables for paths and timezone.
30-
# This makes the toolchain available to ALL subsequent users (root and coder).
3131
ENV CONDA_DIR=/opt/conda
3232
ENV PATH=${CONDA_DIR}/bin:${PATH}
3333
ENV TZ=Asia/Shanghai
@@ -50,16 +50,16 @@ RUN \
5050
&& /bin/bash miniforge.sh -b -p ${CONDA_DIR} \
5151
&& rm miniforge.sh \
5252
\
53-
# 3. Initialize Conda for the root's shell (useful for subsequent RUN commands).
53+
# 3. Initialize Conda for the root's shell.
5454
&& conda init bash && . /root/.bashrc \
5555
\
56-
# 4. Install 'uv' into the base conda environment for system-wide access.
56+
# 4. Install 'uv' into the base conda environment.
5757
&& conda install -n base uv -c conda-forge -y \
5858
\
5959
# 5. Create the target Python environment.
6060
&& conda create -n py${PYTHON_VERSION} python=${PYTHON_VERSION} -y \
6161
\
62-
# 6. Install core libraries into the new environment using 'uv'.
62+
# 6. Install core libraries into the new environment.
6363
&& uv pip install --python=${CONDA_DIR}/envs/py${PYTHON_VERSION}/bin/python \
6464
numpy \
6565
pandas \
@@ -100,11 +100,11 @@ RUN echo "Verifying root environment..." && \
100100
# Final check as CODER.
101101
USER coder
102102
RUN echo "Verifying coder environment..." && \
103-
# We must source .bashrc to load the 'conda activate' alias in a non-interactive shell.
104-
source ~/.bashrc && \
103+
### --- [ THE FINAL FIX IS HERE ] --- ###
104+
# Use the POSIX-compliant dot ('.') instead of the bash-specific 'source'.
105+
. ~/.bashrc && \
105106
python --version && \
106107
uv --version && \
107108
echo "Coder environment check PASSED!"
108109

109110
# The base image's CMD is inherited automatically.
110-
# No need to specify it again.

0 commit comments

Comments
 (0)