I have recently started playing with containers but I have noticed an issue that the history does not persist after I stop and start the container (Note:- not build it).
I also made a directory to test it. After running the stop and start container the directory is there but yet again the history is all gone. When I run history command all I see is first entry as History. The variable $HISTFILE is set to /root/.bash_history but the file is not in the given location. I even tried to create the .bash_history with no luck funny thing is even though history command showed me history (previous run commands) there was nothing being written in this manually created file.
Anyone faced this issue in the past ?. Any help would be appreciated. My aim is to just retain the history until I destroy the container / retain it after I stop or start the same container.
Additional details:-
Its Linux container (I am running docker engine on Ubuntu).Also the container's OS itself is Ubuntu.