I need to have firefox in docker but due to small amount of shared memory it is constantly crashing. Can you help me with this instruction?
To prevent crashes from happening when running Firefox inside a Docker container, the size of the shared memory located at /dev/shm must be increased. The issue is documented here.
By default, the size is 64MB, which is not enough. It is recommended to use a size of 2GB. This value is arbitrary, but known to work well. Setting the size of /dev/shm can be done via two method:
- By adding the --shm-size 2g parameter to the docker run command. See the Usage section for more details.
- By using shared memory of the host, by mapping /dev/shm via the parameter -v /dev/shm:/dev/shm of the docker run command.