From c4c7d259c61c2360eb51aef87b0422114bfaaace Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Wed, 25 Dec 2024 14:51:50 +0800 Subject: [PATCH] fix: update pyenv installation script to use user-specific environment file - Changed the installation script for pyenv to create a user-specific environment file at $HOME/.pyenv-env.sh instead of a system-wide file in /etc/profile.d/. - Updated the script to source the new environment file, ensuring that the pyenv setup is applied correctly for the user. - This change improves the flexibility and usability of the pyenv installation in Docker environments. --- docker/base-image/install/python/python.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/base-image/install/python/python.sh b/docker/base-image/install/python/python.sh index 0534b9b5f..93493656b 100644 --- a/docker/base-image/install/python/python.sh +++ b/docker/base-image/install/python/python.sh @@ -35,8 +35,8 @@ apt-get install -y \ # Install pyenv curl https://pyenv.run | bash -# Create a file in /etc/profile.d/ -cat > /etc/profile.d/pyenv.sh << 'EOF' +# Create a file in $HOME/.pyenv-env.sh +cat > $HOME/.pyenv-env.sh << 'EOF' export PYENV_ROOT="$HOME/.pyenv" [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" @@ -44,10 +44,10 @@ eval "$(pyenv virtualenv-init -)" EOF # Make the file executable -chmod +x /etc/profile.d/pyenv.sh +chmod +x $HOME/.pyenv-env.sh # Source it immediately for the rest of the installation -source /etc/profile.d/pyenv.sh +source $HOME/.pyenv-env.sh # Install python ${version} via pyenv pyenv install ${version}