From fda16b0c2da4ae5ac40a18a48b0f68a691dcd983 Mon Sep 17 00:00:00 2001 From: l1shen Date: Wed, 20 Nov 2024 19:03:06 +0800 Subject: [PATCH] fix: merge install & rm MANAGED file in same layer (#27) --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 47a9f94..8c1d94e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,14 +47,15 @@ RUN pnpm config set store-dir ${PNPM_HOME}/store && \ # setup uv and python ENV PYTHON_VERSION="3.10.12" ENV PATH="${HOME}/.local/uv_bin/:${PATH}" -RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=${HOME}/.local/uv_bin bash && \ - uv python install ${PYTHON_VERSION} # We need to make python effective globally, but uv currently does not have a command to directly obtain the full path of the current python, so it can be done by manual concatenation. # Also, there is no elegant way to get the current architecture, so we can only solve it by adding all the paths for x64 and arm64 to PATH. ENV PATH="${HOME}/.local/share/uv/python/cpython-${PYTHON_VERSION}-linux-x86_64-gnu/bin:${HOME}/.local/share/uv/python/cpython-${PYTHON_VERSION}-linux-aarch64-gnu/bin:${PATH}" -# Remove EXTERNALLY-MANAGED to allow pip to install packages globally -RUN rm "$(python3 -c "import site, sysconfig; print(sysconfig.get_path('stdlib'));")/EXTERNALLY-MANAGED" + +RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=${HOME}/.local/uv_bin bash && \ + uv python install ${PYTHON_VERSION} && \ + rm "$(python3 -c "import site, sysconfig; print(sysconfig.get_path('stdlib'));")/EXTERNALLY-MANAGED" + # WSL2 GPU Driver libraries load path RUN mkdir -p "/etc/ld.so.conf.d" && \