Fix: Corrected Git Prompt activation.

This commit is contained in:
2025-12-17 07:58:45 +01:00
parent 1d66fc2edc
commit ca8160568b

View File

@@ -18,9 +18,12 @@ RUN curl -sL -o /tmp/packages-microsoft-prod.deb https://packages.microsoft.com/
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/repos/azure-cli/ noble main" > /etc/apt/sources.list.d/azure-cli.list RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/repos/azure-cli/ noble main" > /etc/apt/sources.list.d/azure-cli.list
RUN apt-get update && apt-get install -y azure-cli RUN apt-get update && apt-get install -y azure-cli
# Configure Bash # Add more packages (keep it last to optimize layer caching)
RUN cat <<'EOF' >> /etc/bash.bashrc RUN apt-get install -y zip unzip tree wget nano neovim \
python3 python3-venv python3-pip
# Configure Bash
RUN cat <<'EOF' >> /etc/profile.d/git-prompt-helper
# Include Git prompt helpers if available # Include Git prompt helpers if available
if [ -f /usr/lib/git-core/git-sh-prompt ]; then if [ -f /usr/lib/git-core/git-sh-prompt ]; then
source /usr/lib/git-core/git-sh-prompt source /usr/lib/git-core/git-sh-prompt
@@ -32,9 +35,12 @@ fi
export PATH=$HOME/bin:$PATH export PATH=$HOME/bin:$PATH
EOF EOF
# Add more packages (keep it last to optimize layer caching) RUN cat <<'EOF' >> /etc/skel/.bashrc
RUN apt-get install -y zip unzip tree wget nano neovim \
python3 python3-venv python3-pip if ! command -v __git_ps1 > /dev/null; then
source /etc/profile.d/git-prompt-helper
fi
EOF
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh