Docker和.bash_history
有没有办法与.bash_history
容器共享一个.bash_history
卷,以便每次进入一个shell我有我的bash历史可用于滚动?
如果能够用IPython来做同样的事情也会很棒。
这是关于卷的文档的示例: 将主机文件挂载为数据卷 :
docker run --rm -it -v ~/.bash_history:/root/.bash_history ubuntu /bin/bash
这会让你进入一个新的容器中的bash shell,你将从主机获得你的bash历史logging ,当你退出容器时,主机将在容器中input命令的历史logging。
在你docker-compose.override.yml
:
version: '2' services: whatever: … volumes: - … - ~/.bash_history:/root/.bash_history
要保留IPython历史logging,可以将IPYTHONDIR
环境variables设置为映射卷中的某个位置。
docker-compose.override.yml
将如下所示:
version: '2' services: some-service: environment: - IPYTHONDIR=/app/.ipython volumes: - .:/app
- 如何从容器中运行的脚本访问docker容器的元数据?
- pipe道docker工运行容器IDdocker执行
- 错误的replace错误在基于Debian的Docker镜像中安装NVM
- 如何在一个命令ssh + bash到Docker容器中
- 我的boot2docker安装似乎没有工作。 我究竟做错了什么?
- 在docker容器中安装openssh-server,g ++,gdb和gdbserver Visual C ++ for Linux Development + Docker
- 无法在Docker容器中执行二进制文件(“Operation not permitted”)
- Dockerfile – 如何将答案传递给提交后apt-get安装?
- 如何在Dockerfile中运行bash函数