Run docker and keep zshhistory from host (zsh shell) in docker container (bash shell)

I am using options:

HIST_FILE=/root/.bash_history -v ~/.zshhistory:/root/.bash_history

but it is not getting the zshhistory in the container.

  • Bluemix IBM Container with Mongodb connection failed
  • Is this possible to tag latest to multiple images in docker?
  • Is docker-machine required on linux?
  • How can I build a coturn server with dockerfile configuration?
  • How to downgrade version of docker used by docker-machine and boot2docker?
  • Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 in Docker container
  • Using docker behind a proxy on an EC2 instance
  • Issues on Apache when sharing files in between docker and Mac OS X
  • node.js proxy app in docker behind nginx proxy
  • Django can't connect to Postgres in Docker setup
  • Docker create base image
  • Unable to install windowsServerCore Container Image
  • 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. -v ~/.zshhistory:/root/.bash_history.
    Complete command will be like docker run -e HIST_FILE='/root/.bash_history' -v ~/.zshhistory:/root/.bash_history <image_name>

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.