LoginSignup
0
0

More than 3 years have passed since last update.

docker debian系イメージでgit系が使いやすくなるレシピ

Last updated at Posted at 2020-06-13

開発環境作るときにコピペすると便利。

Dockerfile
FROM # debian系のimage ex: buildpack-deps ruby node

# 日本語環境追加については https://qiita.com/hikaruna/items/51f4da641f91ce25cadf
RUN apt-get update && apt-get install -y \
locales \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* \
&& sed -i -e 's/# \(ja_JP.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=ja_JP.UTF-8

RUN apt-get update && apt-get install -y \
less \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
ENV LANG=ja_JP.UTF-8

RUN { \
echo 'source /usr/share/bash-completion/completions/git' ; \
echo 'source /etc/bash_completion.d/git-prompt' ; \
} >> /etc/bash.bashrc
ENV PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "' \
GIT_PS1_SHOWDIRTYSTATE=1 \
GIT_PS1_SHOWCOLORHINTS=1

後は、各自.gitconfig等をmountしたり、ssh_auth_sockをマウントしたら完璧だと思う。
(そしてvscode remote containerはそのへんを勝手に自動でやってくれるので便利=おせっかい)

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