Search code examples
docker-volumezalenium

How to set zalenium volume accessModes:ReadWriteMany


I'm newbie for docker. I want to shared files with zalenium but how can I pass accessModes:ReadWriteMany?

My test case needs to file upload.

I run zalenium like below

docker run --rm -ti -d --name zalenium -p 4444:4444 -v /var/run/docker.sock:/var/run/docker.sock -v /d/Zalanium/:/home/seluser/videos -v /d/shared_folder:/data --privileged   dosel/zalenium start --videoRecordingEnabled false

I have a file to share with zalenium contaniers.

My shared folders : -v /d/shared_folder:/data

When I looked at zalenium website, They mentioned about shared folders

Like the Docker version of Zalenium, the Kubernetes version can automatically mount shared folders, the only catch is that when you are using persistent volumes you need to make sure that the Access Mode is set to ReadWriteMany, otherwise the selenium nodes will not be able to mount it.

I have not found any example.

Thank you for in advanced.


Solution

  • The answer is written on zalenium wesite. I have missed that part.

    Answer is below :

    This is a collection of folders that you can mount as volumes when starting Zalenium by prefixing the destination with /tmp/node/, and it will be mapped across all the docker-selenium containers from the root folder after stripping the /tmp/node/ prefix.

    For example, mounting: -v /your/local/folder:/tmp/node/home/seluser/folder will map to /home/seluser/folder on the node.

    This can be used to provide further customization to your nodes, such as adding client certificates for your browser, or mimicking prior multi-purpose folder, both shown below.