From 5fd2b82ef366d58575a1cab5da21117d8195dc5a Mon Sep 17 00:00:00 2001 From: Eragos Date: Thu, 14 Apr 2016 23:19:37 +0200 Subject: [PATCH] add bash envoirement to dockersh --- .dfminstall | 1 + docker.bashrc | 29 +++++++++++++++++++++++++++++ functions | 6 +++++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docker.bashrc diff --git a/.dfminstall b/.dfminstall index 7cd874c..62eb473 100644 --- a/.dfminstall +++ b/.dfminstall @@ -3,5 +3,6 @@ bin/dfm chmod 0755 README.md skip aliases skip +docker.bashrc skip functions skip tmux.start.sh skip diff --git a/docker.bashrc b/docker.bashrc new file mode 100644 index 0000000..853e483 --- /dev/null +++ b/docker.bashrc @@ -0,0 +1,29 @@ +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# colors +export CLICOLOR=1 +export LSCOLORS=dxfxcxbxegedabagacad + +# history +export HISTCONTROL=erasedups +export HISTFILESIZE=10000 +export HISTSIZE=10000 +shopt -s histappend + +# prompt +export PS1="\[\033[31m\]Docker Container: \[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33; 1m\]\w\[\033[m\]\$ " +export CLICOLOR=1 +export LSCOLORS=ExFxBxDxCxegedabagacad + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" + +# load functions +[[ -f "/.docker.functions" ]] && source "/.docker.functions" +[[ -f "/.docker.aliases" ]] && source "/.docker.aliases" +[[ -f "/.docker.container" ]] && source "/.docker.container" \ No newline at end of file diff --git a/functions b/functions index e57055d..bd9ac2d 100644 --- a/functions +++ b/functions @@ -1,6 +1,10 @@ #Docker: bash into running Docker container dockersh() { - docker exec -it $1 bash + docker cp ~/.dotfiles/docker.bashrc $1:/.docker.bashrc + docker cp ~/.dotfiles/aliases $1:/.docker.aliases + docker cp ~/.dotfiles/functions $1:/.docker.functions + + docker exec -it $1 bash --rcfile /.docker.bashrc } #Docker: bash into running Docker container