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?

  • Are docker images portable across different linux flavours?
  • org.jolokia:docker-maven-plugin:0.10.4:push (code: 500, Internal Server Error)
  • Docker run Error: Status 403 trying to pull repository Unable to access the repository:
  • Debug Docker application built with SBT Native Packager
  • Some questions about Docker Image
  • Query port number used by process in a docker container
  • ECONNREFUSED 127.0.0.1:3306 to mysql container inside jenkins
  • Python script to add data to postgres docker container runs multiple times
  • separate applications on kubernetes cluster
  • docker tool box docker build behind proxy is not working in windows
  • Access KVM VM over the network from a Docker container
  • denied: requested access to the resource is denied : docker
  • 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.