docker exec -it xxx /bin/bash
some containers give:
root@ba5b2a06ef27:/usr/src/myapp#
some containers have bash-4.2#
. I have compared the output of env, both hostname is a combination of number and letters. But just the login one is root@xxxx
, the other one is bash-4.2#
. why
1 Answer
It just depends on the particular image & its configuration (specifically the PS1
environment variable).
For example you can start a container using an Ubuntu image that has the environment variable set to the value bash-4.2#
. Another container may be using exactly the same version of Ubuntu, but the PS1
environment variable may be set to something different.