本文介绍了Docker和.bash_history的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法与docker容器共享一个 .bash_history
卷,这样每当我进入一个shell我有我的bash历史可以滚动? p>
可以使用IPython也能做同样的事情。
解决方案
这是来自:
docker运行--rm -it -v〜/ .bash_history:/root/.bash_history ubuntu / bin / bash
Is there any way to share a .bash_history
volume with a docker container so that everytime I go into a shell I have my bash history available for scrolling through?
Would be awesome to be able to do the same thing with IPython too.
解决方案
It is the example from the documentation about volume: Mount a host file as a data volume:
docker run --rm -it -v ~/.bash_history:/root/.bash_history ubuntu /bin/bash
这篇关于Docker和.bash_history的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!