Docker Community Forums

Share and learn in the Docker community.

Exporting multiple volumes from a single container

docker

(Idogold) #1

Hi all,
I’m new to docker and I’m digging within the documentation and google for the last couple of hours on a documented solution for my problem (I didn’t try it yet)

I’m looking for the right way to expose/export folders within the container for the host to be shared with other containers on the same host.
the use case is simple , I have apache server I want to export (in resistant way) 2 directories
/var/log/apache – to see logs from the host
/var/www – to upload content from the host

all is well I can use the “docker run -v” command , in a single directory case its obvious to me
//example //
docker run -d -v /var/logs/apache1:/var/log/apache

what is the case for multiple directories?
docker run -v hostdirectory1:containerdirectory1 , hostdirectory2:containerdirectory2 , hostdirectory3:containerdirectory3

OR

docker run -v hostdirectory1:containerdirectory1 , -v hostdirectory2:containerdirectory2 , -v hostdirectory3:containerdirectory3


is there a better way ?