From 08b08c78b571a2b339508412acc59f02b8d9435a Mon Sep 17 00:00:00 2001 From: Carlos Cesario Date: Sat, 26 Mar 2016 16:41:46 -0300 Subject: Identify container through PS1 shell variable As suggested it was created the variable KOLLA_SERVICE_NAME to identify the container service name through PS1 shell variable. This method it was previously discussed in IRC. https://goo.gl/k7AdEg The other option it was usage hostname param in kolla_docker, but currently docker does not support it due this issue: https://github.com/docker/compose/issues/2460 The final result is like this: $ docker exec -it heka /bin/bash (heka)[heka@kolla-control /]$ $ docker exec -it mariadb /bin/bash (mariadb)[mysql@kolla-control /]$ More details can be accessed through this link http://paste.openstack.org/show/493689/ Closes-Bug: #1557454 Change-Id: I6aab8d640a8ebb17baa9d6d4f1edd6e331674713 --- docker/base/kolla_bashrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docker/base/kolla_bashrc (limited to 'docker/base/kolla_bashrc') diff --git a/docker/base/kolla_bashrc b/docker/base/kolla_bashrc new file mode 100644 index 000000000..c797e51a9 --- /dev/null +++ b/docker/base/kolla_bashrc @@ -0,0 +1,6 @@ + +#### Custom data added by Kolla +_KBOLD="\[$(tput bold)\]" +_KRESET="\[$(tput sgr0)\]" + +PS1="${_KBOLD}(${KOLLA_SERVICE_NAME})${_KRESET}[\u@\h \W]\\$ " -- cgit v1.2.3