Last active
          September 28, 2022 13:01 
        
      - 
      
 - 
        
Save gido/9b7e323571cf61820bd4baef92e30861 to your computer and use it in GitHub Desktop.  
    Example to keep your bash history with docker compose
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | version: '3.6' | |
| services: | |
| dev: | |
| image: ubuntu | |
| volumes: | |
| # '~/.docker_bash_history' file should exist before mounting | |
| - $HOME/.docker_bash_history:/root/.bash_history | |
| # ... | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | version: '3.6' | |
| services: | |
| dev: | |
| image: ubuntu | |
| environment: | |
| HISTFILE: /root/hist/.bash_history | |
| volumes: | |
| - bashhistory:/root/hist | |
| volumes: | |
| bashhistory: | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Blogged about it : https://antistatique.net/en/we/blog/2019/11/12/tips-docker-keep-your-bash-history