[LINUX] docker alpine bash git prompt completion setting memo

Dockerfile


FROM alpine

RUN apk add bash
RUN sed -i 's/root:x:0:0:root:\/root:\/bin\/ash/root:x:0:0:root:\/root:\/bin\/bash/' /etc/passwd

RUN apk add git-bash-completion
WORKDIR /usr/share/bash-compeletion/completions
RUN curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o git-prompt
RUN : "Append git related settings to bashrc" && { \
  echo 'source /usr/share/bash-completion/completions/git'; \
  echo 'source /etc/bash_completion.d/git-prompt'; \
  echo "export PS1='[\\[email protected]\\h \\W\$(__git_ps1 \" (%s)\")]\\\$ '" ; \
} | tee -a ~/.bashrc
ENV PROMPT_COMMAND '__git_ps1 "\[email protected]\h:\w" "\\\$ "'
ENV GIT_PS1_SHOWDIRTYSTATE true
ENV GIT_PS1_SHOWCOLORHINTS true

I don't want to use alpine in the development container ... Can anyone please tell me a better recipe

Recommended Posts

docker alpine bash git prompt completion setting memo
[Linux setting series] Prompt setting of bash. / prompt / bash / shell
Bash script memo