Run docker and keep zshhistory from host (zsh shell) in docker container (bash shell)
I am using options:
but it is not getting the zshhistory in the container.
One Solution collect form web for “Run docker and keep zshhistory from host (zsh shell) in docker container (bash shell)”
As I understood you want to use volume with
-v option and trying to set environment variable with
HIST_FILE=/root/.bash_history for container.
In this case correct syntax is to set an environment variable with
-e option, e.g.
-e HIST_FILE='/root/.bash_history' and mount required volume with
-v option, e.g.
Complete command will be like
docker run -e HIST_FILE='/root/.bash_history' -v ~/.zshhistory:/root/.bash_history <image_name>