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.

  • ASP.NET Core 1.0 RC1 Docker with dnu publish
  • Multiple websites on one docker engine
  • How to pull images to docker registry?
  • docker run container happens error when mapped the container's port with machine
  • How to view log output using docker-compose run?
  • Migrating dockerized redis to another server
  • Sharing data across containers
  • Node.js tcp sockets + linked Docker containers
  • Docker: Nginx + PHP-FPM and multiple sites
  • Docker-Compose: Bash command substitution
  • Mongodb, Boot2Docker, and Replica Set connections
  • Install mysqlclient-python in Docker
  • 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.