docker进入容器显示bash-4.2#如下:
[root@VM-4-15-centos shopmall]# docker exec -it -u root 1f654abf60ac bash
bash-4.2#
出现上述问题是因为在/root/目录下缺少**.bash_profile .bashrc** 这两个文件
解决办法如下:
[root@VM-4-15-centos shopmall]# docker exec -it 1f654abf60ac bash
bash-4.2# cd /etc/skel/
bash-4.2# cp .bash_profile /root/
bash-4.2# cp .bashrc /root/
bash-4.2# exit
exit
[root@VM-4-15-centos shopmall]# docker exec -it 1f654abf60ac bash
[root@mall4j-mysql /]#