Compare commits
2 Commits
374b4e48bf
...
6325017ba7
| Author | SHA1 | Date | |
|---|---|---|---|
| 6325017ba7 | |||
| 65bbb79396 |
@@ -20,11 +20,13 @@ RUN apt-get update && apt-get install -y azure-cli
|
|||||||
|
|
||||||
# Configure Bash
|
# Configure Bash
|
||||||
RUN cat <<'EOF' >> /etc/bash.bashrc
|
RUN cat <<'EOF' >> /etc/bash.bashrc
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
# Then PS1 can include __git_ps1 which is optimized and shows branch + state:
|
# Then PS1 can include __git_ps1 which is optimized and shows branch + state:
|
||||||
PS1='\[\e[32m\]\u@\h\[\e[0m\]:\[\e[34m\]\w\[\e[0m\]\[\e[33m\]$(__git_ps1 " (%s)")\[\e[0m\]\$ '
|
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
|
fi
|
||||||
|
|
||||||
export PATH=$HOME/bin:$PATH
|
export PATH=$HOME/bin:$PATH
|
||||||
|
|||||||
@@ -107,11 +107,10 @@ fi
|
|||||||
EXTRA_ARGS+=(
|
EXTRA_ARGS+=(
|
||||||
"--mount" "type=volume,source=$VOLUME_NAME,target=/home/${USER_NAME}"
|
"--mount" "type=volume,source=$VOLUME_NAME,target=/home/${USER_NAME}"
|
||||||
"--mount" "type=bind,source=$(pwd),target=/workdir"
|
"--mount" "type=bind,source=$(pwd),target=/workdir"
|
||||||
|
"--env" "ACCOUNT_NAME=$ACCOUNT_NAME"
|
||||||
|
"--name" "azure-cli-$VOLUME_NAME"
|
||||||
|
"--workdir" "/workdir"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Run the container
|
# Run the container
|
||||||
$CMD run --rm -it \
|
$CMD run --rm -it ${EXTRA_ARGS[@]} $IMAGE_NAME --user "$USER_NAME" "$@"
|
||||||
${EXTRA_ARGS[@]} \
|
|
||||||
--name "azure-cli-$VOLUME_NAME" \
|
|
||||||
--workdir /workdir \
|
|
||||||
$IMAGE_NAME --user "$USER_NAME" "$@"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user