Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2824

docker alpineのbash git prompt completion設定メモ

$
0
0
Dockerfile
FROM alpineRUN 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/completionsRUN curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o git-prompt
RUN : "git関連の設定をbashrcにappend"&&{\
echo'source /usr/share/bash-completion/completions/git';\
echo'source /etc/bash_completion.d/git-prompt';\
echo"export PS1='[\\u@\\h \\W\$(__git_ps1 \" (%s)\")]\\\$ '";\
} | tee-a ~/.bashrc
ENV PROMPT_COMMAND '__git_ps1 "\u@\h:\w" "\\\$ "'ENV GIT_PS1_SHOWDIRTYSTATE trueENV GIT_PS1_SHOWCOLORHINTS true

開発コンテナでalpineなんか使いたくないのだが…。
誰かもっと良いレシピ教えて下さい


Viewing all articles
Browse latest Browse all 2824

Latest Images

Trending Articles