Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
Release 20.06.2
Browse files Browse the repository at this point in the history
  • Loading branch information
accetto committed Jun 21, 2020
2 parents df7d387 + eb56d4e commit 37779cf
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 34 deletions.
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@

***

### Release 20.06.2

- Firefox **77.0.1**
- **IMPORTANT**: Firefox multi-process mode is default now and therefore larger shared memory (`/dev/shm`) is required (see bellow)
- environment variable **MOZ_FORCE_DISABLE_E10S** is not set by default any more
- **containers with Firefox require larger shared memory** (`/dev/shm`) to run reliably
- at least **256MB** is recommended (default is just 64MB)
- use `docker run --shm-size=256m`
- or `shm_size: 256m` at service level in docker-compose files
- see [Firefox multi-process][that-wiki-firefox-multiprocess] in Wiki for description and instructions
- this fixes the [issue #7 (Firefox 77.0.1 scrambles pages)](https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/issues/7)
- Internet browsing should be **sand-boxed** now
- tag `singleprocess` introduced
- which is single-threaded, but
- please be aware that in **this** release (still Firefox **77.0.1**) webpages still will be scrambled (issue #7)
- it should be fixed by Mozilla in the next Firefox release
- Other changes:
- default VNC resolution changed to 1360x768
- added some help comments into Dockerfile
- README updated

### Release 20.06.1

- Quick mitigation of issue [#7 (Firefox 77.0.1 scrambles pages)](https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/issues/7)
Expand Down Expand Up @@ -260,8 +281,10 @@

[this-docker]: https://hub.docker.com/r/accetto/ubuntu-vnc-xfce-firefox-plus/
[this-github]: https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus
[this-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/wiki
[this-base]: https://hub.docker.com/r/accetto/ubuntu-vnc-xfce
[this-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/wiki

[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess

[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
[accetto-github-ubuntu-vnc-xfce-firefox]: https://github.com/accetto/ubuntu-vnc-xfce-firefox
Expand Down
42 changes: 28 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
# ./hooks/build dev
# ./hooks/build dfw
# ./hooks/build nux
# ./hooks/build nux --no-cache
# ./hooks/build dfw
# ./hooks/build dfw --no-cache
# ./hooks/build dev
# ./hooks/build dev --no-cache
# ./hooks/build nux-singleprocess
# ./hooks/build dfw-singleprocess
# ./hooks/build dev-singleprocess

### Build it locally like, for example:
### ./utils/util-hdx.sh Dockerfile 2
### Test it locally like, for example:
### ./hooks/test nux
### Result last line should be:
### + exit 0
### If 'exit 1' then adjust the version sticker variables in
### ./hooks/env

ARG BASETAG=latest

Expand All @@ -11,21 +25,21 @@ FROM accetto/ubuntu-vnc-xfce:${BASETAG} as stage-install
USER 0

### 'apt-get clean' runs automatically
# RUN apt-get update && apt-get install -y \
# firefox \
# && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
firefox \
&& rm -rf /var/lib/apt/lists/*

### Mitigating issue #7 (Firefox 77.0.1 scrambles pages) - rollback to version 76.0.1
### Alternatively install an explicit Firefox version
### http://releases.mozilla.org/pub/firefox/releases/67.0.4/linux-x86_64/en-US/firefox-67.0.4.tar.bz2
ENV \
FIREFOX_VERSION=76.0.1 \
FIREFOX_DISTRO=linux-x86_64 \
FIREFOX_PATH=/usr/lib/firefox
RUN mkdir -p ${FIREFOX_PATH} \
&& wget -qO- http://releases.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/${FIREFOX_DISTRO}/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 \
| tar xvj -C /usr/lib/ \
&& ln -s ${FIREFOX_PATH}/firefox /usr/bin/firefox
# ENV \
# FIREFOX_VERSION=76.0.1 \
# FIREFOX_DISTRO=linux-x86_64 \
# FIREFOX_PATH=/usr/lib/firefox
# RUN mkdir -p ${FIREFOX_PATH} \
# && wget -qO- http://releases.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/${FIREFOX_DISTRO}/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 \
# | tar xvj -C /usr/lib/ \
# && ln -s ${FIREFOX_PATH}/firefox /usr/bin/firefox

### Alternatively install an explicit Firefox version
### http://releases.mozilla.org/pub/firefox/releases/67.0.4/linux-x86_64/en-US/firefox-67.0.4.tar.bz2
Expand Down Expand Up @@ -103,7 +117,7 @@ ENV \
VERSION_STICKER=${ARG_VERSION_STICKER} \
VNC_BLACKLIST_THRESHOLD=${ARG_VNC_BLACKLIST_THRESHOLD:-20} \
VNC_BLACKLIST_TIMEOUT=${ARG_VNC_BLACKLIST_TIMEOUT:-0} \
VNC_RESOLUTION=${ARG_VNC_RESOLUTION:-1024x768}
VNC_RESOLUTION=${ARG_VNC_RESOLUTION:-1360x768}

### Preconfigure Xfce
COPY [ "./src/home/Desktop", "./Desktop/" ]
Expand Down
44 changes: 29 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@

***

**WARNING** about images with Firefox

Starting from the release **20.06.2**, the single-process and multi-process modes of the Firefox browser have been swapped. The mainstream image tagged as `latest` run Firefox with **multi-process enabled** now. A new image tagged as `singleprocess` has been introduced. Be aware, that multi-process requires larger shared memory (`/dev/shm`). At least **256MB** is recommended. Please check the [Firefox multi-process][that-wiki-firefox-multiprocess] page in Wiki for more information and the instructions, how to set the shared memory size in different scenarios.

***

**Attention:** Resources for building images with default Firefox installation without configuration support can be found in its own GitHub repository [ubuntu-vnc-xfce-firefox][accetto-github-ubuntu-vnc-xfce-firefox]. Resources for building base images are in the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce].

**This repository** contains resources for building a Docker image based on [Ubuntu][docker-ubuntu] with [Xfce][xfce] desktop environment, **VNC**/[noVNC][novnc] servers for headless use and the current [Firefox][firefox] web browser with pre-configuration support.
Expand Down Expand Up @@ -73,6 +79,11 @@ The image is regularly maintained and rebuilt. The history of notable changes is
![badge-VERSION_STICKER_LATEST][badge-VERSION_STICKER_LATEST]
![badge-github-commit-latest][badge-github-commit-latest]

- `singleprocess` is similar to `latest`, but it is built without the build argument **ARG_MOZ_FORCE_DISABLE_E10S**, so the Firefox multiprocess is **disabled**

![badge-VERSION_STICKER_LATEST][badge-VERSION_STICKER_LATEST]
![badge-github-commit-latest][badge-github-commit-latest]

- **accetto/ubuntu-vnc-xfce-firefox-plus-preferences**

This image is not actually contained in the [Docker repository][accetto-docker], because it is intended to keep pre-configured user-specific **Firefox preferences**. Users can put their favorite preferences into the configuration files and build the image using the provided [Dockerfile-plus-preferences][this-dockerfile-plus-preferences]. The [HOWTO][this-wiki-howto] page in [Wiki][this-wiki] describes it in more details.
Expand Down Expand Up @@ -128,31 +139,32 @@ Examples can be found in [Wiki][this-wiki].

## Firefox multi-process

Firefox multi-process (also known as **Electrolysis** or just **E10S**) causes in Docker container heavy crashing (**Gah. Your tab just crashed.**) and therefore it needs to be disabled.
Firefox multi-process (also known as **Electrolysis** or just **E10S**) can cause heavy crashing in Docker containers (**Gah. Your tab just crashed.**) if there is not enough shared memory.

In Firefox versions till **67.0.4** it could be done by setting the preferences **browser.tabs.remote.autostart** and **browser.tabs.remote.autostart.2** to **false**. However, Mozilla has removed this possibility since the Firefox version **68.0**.
In Firefox versions till **76.0.1** it has been possible to disable multi-process by setting the environment variable **MOZ_FORCE_DISABLE_E10S**. However, in Firefox **77.0.1** it has caused ugly scrambling of almost all web pages, because they were not decompressed.

Since than it can be done only by setting the following environment variable:
Mozilla has fixed the problem in the next release, but they still plan to stop supporting the switch completely. That is why I've decided, that the mainstream image tagged as `latest` will use multi-process by default, even if it requires larger shared memory. On the positive side, performance should be higher and Internet browsing should be sand-boxed.

```bash
MOZ_FORCE_DISABLE_E10S
```
A new image tagged as `singleprocess` has been introduced. It can be used in scenarios, where increasing the shared memory size is not possible or not wanted.

Please check the Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] for more information and the instructions, how the shared memory size can be set in different scenarios.

### Setting shared memory size

Therefore the image tagged `latest` sets this variable to **1** by using the build argument **ARG_MOZ_FORCE_DISABLE_E10S**.
Instability of multi-process Firefox is caused by setting the shared memory size too low. Docker assigns only **64MB** by default. Testing on my computers has shown, that using at least **256MB** completely eliminates the problem. However, it could be different on your system.

Note that any value will actually disable the multi-process feature, so the both following settings would have the same effect:
The Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size. It's really simple, if you need it for a single container started from the command line.

For example, the following container will have its shared memory size set to 256MB:

```bash
MOZ_FORCE_DISABLE_E10S=1
MOZ_FORCE_DISABLE_E10S=0
docker run -d -P --shm-size=256m accetto/xubuntu-vnc-xfce-firefox-plus
```

Building an image without the build argument **ARG_MOZ_FORCE_DISABLE_E10S** enables the Firefox multi-process feature.

To check whether the Firefox multi-process is enabled or disabled, navigate the web browser to the following URL:
You can check the current shared memory size by executing the following command inside the container:

```bash
about:support
df -h /dev/shm
```

## Running containers in background (detached)
Expand Down Expand Up @@ -288,6 +300,8 @@ Credit goes to all the countless people and companies who contribute to open sou
[this-wiki-troubleshooting]: https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/wiki/Troubleshooting
[this-wiki-faq]: https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/wiki/Frequently-asked-questions

[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess

[this-dockerfile-plus-preferences]: https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/blob/master/Dockerfile-plus-preferences
[this-dockerfile-plus-profile]: https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/blob/master/Dockerfile-plus-profile

Expand Down Expand Up @@ -358,6 +372,6 @@ Credit goes to all the countless people and companies who contribute to open sou

<!-- latest tag badges -->

[badge-VERSION_STICKER_LATEST]: https://badgen.net/badge/version%20sticker/ubuntu18.04.4-firefox76.0.1/blue
[badge-VERSION_STICKER_LATEST]: https://badgen.net/badge/version%20sticker/ubuntu18.04.4-firefox77.0.1/blue

[badge-github-commit-latest]: https://images.microbadger.com/badges/commit/accetto/ubuntu-vnc-xfce-firefox-plus.svg
24 changes: 20 additions & 4 deletions hooks/env
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,44 @@ BASETAG=""
TODAY=$(date +%Y-%m-%d)

### Warning! The values must be explicit strings (used by utils).
VERSION_STICKER_LATEST="ubuntu18.04.4-firefox76.0.1"
VERSION_STICKER_LATEST="ubuntu18.04.4-firefox77.0.1"

VERSION_STICKER="${VERSION_STICKER_LATEST}"

case "${DOCKER_TAG}" in

latest)
BASETAG="latest"
IS_SINGLEPROCESS_BUILD=yes
;;

dev | dev-preferences | dev-profile)
BASETAG="dev"
IS_SINGLEPROCESS_BUILD=yes
;;

dfw | dfw-preferences | dfw-profile)
BASETAG="dfw"
IS_SINGLEPROCESS_BUILD=yes
;;

nux | nux-preferences | nux-profile)
BASETAG="nux"
;;

singleprocess)
BASETAG="latest"
IS_SINGLEPROCESS_BUILD=yes
;;

dev-singleprocess)
BASETAG="dev"
IS_SINGLEPROCESS_BUILD=yes
;;

dfw-singleprocess)
BASETAG="dfw"
IS_SINGLEPROCESS_BUILD=yes
;;

nux-singleprocess)
BASETAG="nux"
IS_SINGLEPROCESS_BUILD=yes
;;
Expand Down

0 comments on commit 37779cf

Please sign in to comment.