Docker Bash Has No Colour

When I run

docker run -i -t python /bin/bash

the resulting terminal has no color.

  • Docker continuum/miniconda3 container not showing “conda”
  • In docker cpu usage calculation what are: TotalUsage, SystemUsage, PercpuUsage and what does the calculation means?
  • Docker + Nginx deleted folder issue
  • Remove an image from hub
  • ssh using socket w/ docker for mac
  • mongo addShard “No common protocol found” errmsg 126
  • I’ve looked at the following links and they haven’t helped:

    Docker bash prompt not display color

    https://groups.google.com/forum/#!topic/docker-user/Bp4BaWRw6k4

    https://github.com/docker/docker/issues/9299

    I’m using the Docker Quickstart Terminal from the Docker Toolbox on Windows 10. I have docker version 1.12.0, build 8eab29e.

  • Docker Alpine Texlive
  • How to restrict cpu usage from host to docker container
  • Nano and Midnight Commander don't work on Docker for Windows beta
  • how to use test-kitchen in multi node environment?
  • curl in Docker container fails b/c of ssl
  • Running Docker and Jekyll together in a same ec2 instance
  • One Solution collect form web for “Docker Bash Has No Colour”

    To fix this you need to update the ~/.bashrc file.

    Adding something like this (borrowed from the default Ubuntu ~/.bashrc file) should do the trick:

    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
    

    Once you’ve updated the ~/.bash file, you need to reload the file by running source ~/.bashrc.

    You may want to create your own dockerfile which does this automatically.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.