I want to set $PS1
environment variable to the container. It helps me to identify multilevel or complex docker environment setup. Currently docker container prompts with:
root@container-id#
If I can change it as following , I can identify the container by looking at the $PS1
prompt itself.
[Level-1]root@container-id#
I did experiments by exporting $PS1
by making my own image (Dockerfile
), .profile
file etc. But it's not reflecting.
This Dockerfile sets PS1
by doing:
RUN echo 'export PS1="[\u@docker] \W # "' >> /root/.bash_profile