@@ -11,7 +11,7 @@ and made the source code freely available under the [Apache License 2.0](LICENSE
11
11
Docker images for Grid 4 come with a handful of tags to simplify its usage, have a look at them in one of
12
12
our [ releases] ( https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.0.0-20211025 )
13
13
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.
15
15
16
16
Doubts? Questions? Get in touch through the different communication channels available in the ** Community** section.
17
17
676
676
677
677
The reason _ might_ be that you've set the ` START_XVFB ` environment variable to "false", but forgot to
678
678
actually 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