Mounting multiple volumes on a docker container?

I know I can mount a directory in my host on my container using something like

docker run -t -i -v '/on/my/host:/on/the/container' ubuntu /bin/bash

Is there a way to create more than one host-container pair? e.g. a comma-separated list, or pass in an array?

  • Why won't my docker-cmd execute with sh?
  • Viewing all run parameters of a docker container
  • Send data from host to pool of docker containers
  • Is it good practice to have my sites cert.key and cert.pem in a Nginx Docker container?
  • How to enable MongoDB access control using a Docker container?
  • client access to docker swarm
  • libgd not installed in php:5.6-cli docker
  • How to remove development dependencies in production docker images
  • Docker swarm certificates
  • Jersey UniformInterfaceException when doing a POST with docker-client
  • Deploy web app having db on different container and use service discovery for communication
  • Docker installation on OpenSUSE 13.1
  • 2 Solutions collect form web for “Mounting multiple volumes on a docker container?”

    Pass multiple -v arguments.

    For instance:

    docker -v /on/my/host/1:/on/the/container/1 \
           -v /on/my/host/2:/on/the/container/2 \
           ...
    

    Or you can do

    docker run -v /var/volume1 -v /var/volume2 DATA busybox true
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.