jlesage / docker-firefox

Docker container for Firefox
MIT License
1.61k stars 288 forks source link

Slow performance of firefox 26 #90

Open ashonline opened 3 years ago

ashonline commented 3 years ago

Hi,

I mentioned previously that we were looking to run Firefox 26 to support a legacy GWT plugin that was no longer supported beyond that version. To some extent, we succeeded, but the downside is that in practice it is very slow to use. On the other hand the latest version of Firefox is very quick when running on exactly the very same environment, so either it's related to the fact we are using a much older version of Firefox or we've created the image in a suboptimal way.

I'm creating this issue in the hope that it's the second one :-) and that somebody can offer any quick wins that might see us to a performance improvement.

The Dockerfile we created is pasted below, the thing to note is that it uses baseimage-gui as the base image, so it's possible I should post my question to the support forum for that repository instead.

FROM jlesage/baseimage-gui:debian-10-v3.5.6

USER root
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y \
    locales \
    bzip2 \
    libasound2 \
    libdbus-glib-1-2 \
    libgtk2.0-0 \
    procps \
    desktop-file-utils \
    adwaita-icon-theme \
    ttf-dejavu \
    xdotool \
    unzip \
    && rm -rf /var/lib/apt/lists/*

RUN localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8

ENV LANG en_GB.utf8
ENV LANGUAGE en_GB:en
ENV LC_ALL en_GB.UTF-8

There are some other resources that we also copy over when creating the image, that are pretty much taken from jlesage/firefox github repository, eg the wrapper script to start firefox, which uses the "/usr/bin/with-contenv" executable.

One thought that occurred to us is could it be due to the lack of shared memory? We create a docker service rather than a docker container and as such we were unable to cause Docker to allocate more than the default of 64MB. It seemed the settings were ignored in the docker compose file. We're unsure if that's because it runs on Windows though.

Any pointers would be greatly appreciated before we are forced to reevaluate the use of our image.

Thanks