https://github.com/curusarn/persistent-docker-history
Project showing how to setup persistent shell history in a docker container
https://github.com/curusarn/persistent-docker-history
command-line docker docker-compose shell-history user-experience
Last synced: 8 months ago
JSON representation
Project showing how to setup persistent shell history in a docker container
- Host: GitHub
- URL: https://github.com/curusarn/persistent-docker-history
- Owner: curusarn
- Created: 2019-04-29T11:21:23.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-18T22:59:45.000Z (over 3 years ago)
- Last Synced: 2025-07-23T22:35:27.927Z (11 months ago)
- Topics: command-line, docker, docker-compose, shell-history, user-experience
- Language: Makefile
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# persistent-docker-history
Project showing how to setup persistent shell history in a docker container
- I often use commandline inside docker containers.
- I don't like to type same commands over and over again.
- So I use docker-compose volume to keep the history in the project directory instead of docker container.
- I usually populate the history with useful commands and commit them to git so anyone who clones the project can use them.
- And then I just leave the file alone and use it as personal docker history for the project.
## Try it!
1. Clone this repo `git clone git@github.com:curusarn/persistent-docker-history.git`
1. Run `make docker`
1. Use arrow up to get previous commands or whatever
## Configure persistent history for your existing docker-compose
1. Add `.docker_bash_history:/root/.bash_history` to `volumes` in your `docker-compose.yaml`
1. Run `touch .docker_bash_history` (OR something like `echo 'echo "it works!"' > .docker_bash_history`)
1. Use `docker-compose run ...` as usual
### Prerequisities
- `docker`
- `docker-compose`
- standard stuff (`make`, *other things I can't think of right now*)