49 lines
2.0 KiB
Docker
49 lines
2.0 KiB
Docker
FROM ubuntu:24.04
|
|
|
|
# Add essential packages
|
|
RUN apt-get update && apt-get upgrade -y && apt-get install -y curl jq gpg software-properties-common apt-transport-https ca-certificates
|
|
|
|
# Install Terraform
|
|
RUN curl -sL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o - > /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
|
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com noble main" > /etc/apt/sources.list.d/hashicorp.list
|
|
RUN apt-get update && apt-get install -y terraform
|
|
RUN cat <<EOF > /etc/bash_completion.d/terraform
|
|
complete -C /usr/bin/terraform terraform
|
|
EOF
|
|
|
|
# Install Azure CLI
|
|
RUN curl -sL -o /tmp/packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb && \
|
|
dpkg -i /tmp/packages-microsoft-prod.deb && rm -f /tmp/packages-microsoft-prod.deb
|
|
|
|
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
|
|
|
|
# Add more packages (keep it last to optimize layer caching)
|
|
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
|
|
if [ -f /usr/lib/git-core/git-sh-prompt ]; then
|
|
source /usr/lib/git-core/git-sh-prompt
|
|
|
|
# Then PS1 can include __git_ps1 which is optimized and shows branch + state:
|
|
PS1='\[\e[32m\]AzureCLI (\[\e[35m\]${ACCOUNT_NAME}\[\e[0m\])\n\[\e[0m\]\[\e[34m\]\w\[\e[0m\]\[\e[33m\]$(__git_ps1 " (%s)")\[\e[0m\]\$ '
|
|
fi
|
|
|
|
export PATH=$HOME/bin:$PATH
|
|
EOF
|
|
|
|
RUN cat <<'EOF' >> /etc/skel/.bashrc
|
|
|
|
if ! command -v __git_ps1 > /dev/null; then
|
|
source /etc/profile.d/git-prompt-helper
|
|
fi
|
|
EOF
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|