diff --git a/DOCKERHUB.md b/DOCKERHUB.md index b2d75d7..f7ce844 100644 --- a/DOCKERHUB.md +++ b/DOCKERHUB.md @@ -26,7 +26,6 @@ docker run -d \ --name=firefox \ -p 5800:5800 \ -v /docker/appdata/firefox:/config:rw \ - --shm-size 2g \ jlesage/firefox ``` diff --git a/README.md b/README.md index 057e5cb..13dcb0e 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ Foundation and its subsidiary, Mozilla Corporation. * [Routing Based on Hostname](#routing-based-on-hostname) * [Routing Based on URL Path](#routing-based-on-url-path) * [Shell Access](#shell-access) - * [Increasing Shared Memory Size](#increasing-shared-memory-size) * [Allowing the membarrier System Call](#allowing-the-membarrier-system-call) * [Sound Support](#sound-support) * [Setting Firefox Preferences Via Environment Variables](#setting-firefox-preferences-via-environment-variables) @@ -57,7 +56,6 @@ docker run -d \ --name=firefox \ -p 5800:5800 \ -v /docker/appdata/firefox:/config:rw \ - --shm-size 2g \ jlesage/firefox ``` @@ -74,7 +72,6 @@ docker run [-d] \ [-e =]... \ [-v :[:PERMISSIONS]]... \ [-p :]... \ - --shm-size VALUE \ jlesage/firefox ``` | Parameter | Description | @@ -83,7 +80,6 @@ docker run [-d] \ | -e | Pass an environment variable to the container. See the [Environment Variables](#environment-variables) section for more details. | | -v | Set a volume mapping (allows to share a folder/file between the host and the container). See the [Data Volumes](#data-volumes) section for more details. | | -p | Set a network port mapping (exposes an internal container port to the host). See the [Ports](#ports) section for more details. | -| --shm-size | Set the size of `/dev/shm` to `VALUE`. The format of `VALUE` is ``, where `number` must be greater than `0` and `unit` can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). **NOTE**: To avoid crashes, it is recommended to set this value to `2g`. | ### Environment Variables @@ -478,21 +474,6 @@ docker exec -ti CONTAINER sh Where `CONTAINER` is the ID or the name of the container used during its creation. -## Increasing Shared Memory Size - -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](#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. - ## Allowing the membarrier System Call To properly work, recent versions of Firefox need the @@ -566,9 +547,6 @@ via Firefox directly. ### Crashes If Firefox is crashing frequently, make sure that: - - The size of the shared memory located at `/dev/shm` has been increased. See - the [Increasing Shared Memory Size](#increasing-shared-memory-size) section - for more details. - The `membarrier` system call is not blocked by Docker. See the [Allowing the membarrier System Call](#allowing-the-membarrier-system-call) for more details. diff --git a/appdefs.yml b/appdefs.yml index fbd5169..5e00347 100644 --- a/appdefs.yml +++ b/appdefs.yml @@ -22,21 +22,6 @@ app: category: "Tools:" documentation: sections: - - title: Increasing Shared Memory Size - level: 2 - content: |- - To prevent crashes from happening when running {{ app.friendly_name }} - 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](#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. - title: Allowing the membarrier System Call level: 2 content: |- @@ -111,9 +96,6 @@ app: level: 3 content: |- If {{ app.friendly_name }} is crashing frequently, make sure that: - - The size of the shared memory located at `/dev/shm` has been increased. See - the [Increasing Shared Memory Size](#increasing-shared-memory-size) section - for more details. - The `membarrier` system call is not blocked by Docker. See the [Allowing the membarrier System Call](#allowing-the-membarrier-system-call) for more details. @@ -325,15 +307,3 @@ container: devices: - path: /dev/snd description: Optional Linux device to expose to have sound. - - # Extra parameters - extra_params: - - name: shm-size - value: 2g - description: >- - Set the size of `/dev/shm` to `VALUE`. The format of `VALUE` is - ``, where `number` must be greater than `0` and `unit` - can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` - (gigabytes). **NOTE**: To avoid crashes, it is recommended to set this - value to `2g`. - include_in_quick_start: true diff --git a/rootfs/etc/cont-init.d/55-firefox.sh b/rootfs/etc/cont-init.d/55-firefox.sh index 1fe8c77..ab4a68b 100755 --- a/rootfs/etc/cont-init.d/55-firefox.sh +++ b/rootfs/etc/cont-init.d/55-firefox.sh @@ -17,15 +17,6 @@ fi # Copy default preferences. [ -f /config/profile/prefs.js ] || cp /defaults/prefs.js /config/profile/prefs.js -# Verify the size of /dev/shm. -SHM_SIZE_MB="$(df -m /dev/shm | tail -n 1 | tr -s ' ' | cut -d ' ' -f2)" -if [ "$SHM_SIZE_MB" -eq 64 ]; then - echo 'SHM_CHECK_FAIL' > /tmp/.firefox_shm_check -else - echo 'SHM_CHECK_PASS' > /tmp/.firefox_shm_check -fi -chown $USER_ID:$GROUP_ID /tmp/.firefox_shm_check - if /usr/bin/membarrier_check 2>/dev/null; then echo 'MEMBARRIER_CHECK_PASS' > /tmp/.firefox_membarrier_check else diff --git a/rootfs/etc/logmonitor/notifications.d/shm_size/desc b/rootfs/etc/logmonitor/notifications.d/shm_size/desc deleted file mode 100755 index 9b9080b..0000000 --- a/rootfs/etc/logmonitor/notifications.d/shm_size/desc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "$APP_NAME is likely to crash because of the lack of shared memory. Size of shared memory needs to be increased. See the documentation of the Docker container to find out how this can be done." diff --git a/rootfs/etc/logmonitor/notifications.d/shm_size/filter b/rootfs/etc/logmonitor/notifications.d/shm_size/filter deleted file mode 100755 index 914e41d..0000000 --- a/rootfs/etc/logmonitor/notifications.d/shm_size/filter +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -set -e # Exit immediately if a command exits with a non-zero status. -set -u # Treat unset variables as an error. - -LINE="$1" - -if [ "$LINE" = "SHM_CHECK_FAIL" ]; then - echo 'SHM_CHECK_ACK' > /tmp/.firefox_shm_check - exit 0 -fi - -# No match found. -exit 1 - -# vim: set ft=sh : diff --git a/rootfs/etc/logmonitor/notifications.d/shm_size/level b/rootfs/etc/logmonitor/notifications.d/shm_size/level deleted file mode 100644 index e2500fa..0000000 --- a/rootfs/etc/logmonitor/notifications.d/shm_size/level +++ /dev/null @@ -1 +0,0 @@ -WARNING diff --git a/rootfs/etc/logmonitor/notifications.d/shm_size/title b/rootfs/etc/logmonitor/notifications.d/shm_size/title deleted file mode 100755 index 39a42c1..0000000 --- a/rootfs/etc/logmonitor/notifications.d/shm_size/title +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "$APP_NAME lacks of shared memory." diff --git a/rootfs/etc/logmonitor/notifications.d/tab_crash/desc b/rootfs/etc/logmonitor/notifications.d/tab_crash/desc deleted file mode 100755 index 258b037..0000000 --- a/rootfs/etc/logmonitor/notifications.d/tab_crash/desc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "A $APP_NAME tab crashed because of the lack of shared memory. Size of shared memory needs to be increased. See the documentation of this Docker container to find out how this can be done." diff --git a/rootfs/etc/logmonitor/notifications.d/tab_crash/filter b/rootfs/etc/logmonitor/notifications.d/tab_crash/filter deleted file mode 100755 index 21e16b4..0000000 --- a/rootfs/etc/logmonitor/notifications.d/tab_crash/filter +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -set -e # Exit immediately if a command exits with a non-zero status. -set -u # Treat unset variables as an error. - -LINE="$1" - -#if echo "$LINE" | grep -q "OutOfMemoryError occurred...RESTARTING!"; then -if [ "$LINE" = "###!!! [Parent][MessageChannel] Error: (msgtype=0x150084,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv" ] -then - exit 0 -fi - -# No match found. -exit 1 - -# vim: set ft=sh : diff --git a/rootfs/etc/logmonitor/notifications.d/tab_crash/level b/rootfs/etc/logmonitor/notifications.d/tab_crash/level deleted file mode 100644 index 5df7507..0000000 --- a/rootfs/etc/logmonitor/notifications.d/tab_crash/level +++ /dev/null @@ -1 +0,0 @@ -ERROR diff --git a/rootfs/etc/logmonitor/notifications.d/tab_crash/title b/rootfs/etc/logmonitor/notifications.d/tab_crash/title deleted file mode 100755 index 39a42c1..0000000 --- a/rootfs/etc/logmonitor/notifications.d/tab_crash/title +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "$APP_NAME lacks of shared memory."