当我跑的时候
docker run -i -t python /bin/bash生成的端子没有颜色。
我已经看过以下链接,但它们并没有帮助:
Docker bash prompt not display color
https://groups.google.com/forum/#!topic/docker-user/Bp4BaWRw6k4
https://github.com/docker/docker/issues/9299
我在Windows 10上使用Docker工具箱中的Docker快速入门终端。我有docker版本1.12.0,build 8eab29e。
发布于 2016-12-18 03:42:44
要解决此问题,您需要更新~/.bashrc文件。
添加类似这样的代码(从默认的Ubuntu ~/.bashrc文件中借用)应该可以解决这个问题:
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi更新~/.bash文件后,需要通过运行source ~/.bashrc重新加载该文件。
您可能希望创建自己的dockerfile,它会自动执行此操作。
https://stackoverflow.com/questions/40231887
复制相似问题