diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-04-12 09:19:54 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-04-12 09:19:54 +0000 |
| commit | 37e981da735126220039b1938239b32595f7600e (patch) | |
| tree | 0094c1332b66a67f14a1bc2db8deb03010676d7e /docker | |
| parent | 8b0a0f72441983f43dc9a1ed777067e8c45f29e4 (diff) | |
| parent | 08b08c78b571a2b339508412acc59f02b8d9435a (diff) | |
| download | kolla-37e981da735126220039b1938239b32595f7600e.tar.gz kolla-37e981da735126220039b1938239b32595f7600e.zip | |
Merge "Identify container through PS1 shell variable"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/base/Dockerfile.j2 | 16 | ||||
| -rw-r--r-- | docker/base/kolla_bashrc | 6 |
2 files changed, 22 insertions, 0 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index afcc5b30b..34bfac9f9 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -10,6 +10,14 @@ ENV KOLLA_BASE_DISTRO {{ base_distro }} ENV KOLLA_INSTALL_TYPE {{ install_type }} ENV KOLLA_INSTALL_METATYPE {{ install_metatype }} +#### Customize PS1 to be used with bash shell +COPY kolla_bashrc /tmp/ +RUN cat /tmp/kolla_bashrc >> /etc/skel/.bashrc +RUN cat /tmp/kolla_bashrc >> /root/.bashrc + +# PS1 var when used /bin/sh shell +ENV PS1="$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ " + # For RPM Variants, enable the correct repositories - this should all be done # in the base image so repos are consistent throughout the system. This also # enables to provide repo overrides at a later date in a simple fashion if we @@ -17,6 +25,9 @@ ENV KOLLA_INSTALL_METATYPE {{ install_metatype }} {% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %} +# Customize PS1 bash shell +RUN cat /tmp/kolla_bashrc >> /etc/bashrc + #### BEGIN REPO ENABLEMENT # Turns on Elasticsearch repos COPY elasticsearch.yum.repo /etc/yum.repos.d/elasticsearch.repo @@ -152,6 +163,9 @@ RUN yum -y install \ {# endif for base_distro centos,fedora,oraclelinux,rhel #} {% elif base_distro in ['ubuntu', 'debian'] %} +# Customize PS1 bash shell +RUN cat /tmp/kolla_bashrc >> /etc/bash.bashrc + # This will prevent questions from being asked during the install ENV DEBIAN_FRONTEND noninteractive @@ -189,4 +203,6 @@ RUN touch /usr/local/bin/kolla_extend_start \ && chmod 440 /etc/sudoers \ && groupadd kolla +RUN rm -f /tmp/kolla_bashrc + CMD ["kolla_start"] 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]\\$ " |
