@@ -11,7 +11,7 @@ and made the source code freely available under the [Apache License 2.0](LICENSE
1111Docker images for Grid 4 come with a handful of tags to simplify its usage, have a look at them in one of
1212our [ releases] ( https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.0.0-20211025 )
1313
14- To get notifications of new prereleases , add yourself as a "Releases only" watcher.
14+ To get notifications of new releases , add yourself as a "Releases only" watcher.
1515
1616Doubts? Questions? Get in touch through the different communication channels available in the ** Community** section.
1717
676676
677677The reason _ might_ be that you've set the ` START_XVFB ` environment variable to "false", but forgot to
678678actually run Firefox, Chrome or Edge in headless mode.
679+
680+ ### Mounting volumes to retrieve downloaded files
681+
682+ A common scenario is mounting a volume to the browser
683+ container in order to retrieve downloaded files. This
684+ works well in Windows and macOS but not without
685+ workarounds in Linux. For more details, check this
686+ well documented [ issue] ( https://github.com/SeleniumHQ/docker-selenium/issues/1095 ) .
687+
688+ For example, while using Linux, you might be starting a
689+ container in the following way:
690+
691+ ``` bash
692+ docker run -d -p 4444:4444 --shm-size=" 2g" \
693+ -v /home/ubuntu/files:/home/seluser/files \
694+ selenium/standalone-chrome:4.0.0-20211025
695+ ```
696+
697+ That will mount the host ` /home/ubuntu/files ` directory
698+ to the ` /home/seluser/files ` inside the container. The
699+ problem happens because the volume will be mounted as
700+ ` root ` , and therefore the browser cannot write a file to
701+ that directory because it is running under the user
702+ ` seluser ` . This happens because that is how Docker mounts
703+ volumes in Linux, more details in the [ issue] ( https://github.com/moby/moby/issues/2259 ) .
704+
705+ A workaround for this is to create the directory on the
706+ host and change its permissions before mounting. Depending
707+ on your user permissions, you might need to use ` sudo ` for
708+ some of these commands:
709+
710+ ``` bash
711+ mkdir /home/ubuntu/files
712+ chown 1200:1201 /home/ubuntu/files
713+ ```
714+
715+ After doing this, you should be able to download files
716+ to the mounted directory. If you have a better workaround,
717+ please send us a pull request!
718+
0 commit comments