0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

docker alpineのbash git prompt completion設定メモ

Posted at
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 : "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 true
ENV GIT_PS1_SHOWCOLORHINTS true

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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?