When running my Kali Linux docker container headerless-kali-linux
without mounting volumes using the command:
docker run --rm -it headerless-kali-linux
The bash terminal within the container has colours and aesthetic features, which I want. They look like this:
However, when I mount my volumes to the container with the command:
docker run --rm -it -v %cd%root:/root -v %cd%postgresql:/var/lib/postgresql headerless-kali-linux
The aesthetic features go, as if volumes should somehow affect that, and I’m left with plain bash in my terminal. If anyone has any idea why this is happening, please let me know! Thanks in advance!
2
Answers
This problem seems to be fixed when creating docker volumes as opposed to using a local source in the C drive. You can also create a container first, not remove it, see its ID with
docker ps -a
and then populate local directories withdocker cp <container ID>:/path/to/dir /path/to/local/volume
. From here you can attach the volumes to the local sources with the-v /path/to/local/volume:/path/to/dir
option when running.You are mounting
/root
so you are overwriting shell startup files, that could set up the configuration.