Glam Prestige Journal

Bright entertainment trends with youth appeal.

I'm struggling trying to install firefox version 45 on docker container with Ubuntu 14.04 on amd64, the version that I was successfully installed is 28 or latest 50.0.1 however I need to install 45.x because I'm running automated tests with selenium and selenium does not support latest firefox versions, this is how I already tried:

apt-get install -y firefox=28.0+build2-0ubuntu2 : Success
apt-get install firefox : Latest Success
apt-get install -y firefox=45.0+build2-0ubuntu0.14.04.1
---> Running in 9e11da0e632f
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '45.0+build2-0ubuntu0.14.04.1' for 'firefox' was not found

I took as reference

Trying to install it with wget and tar and symbolic link I get this when I try to run firefox:

XPCOMGlueLoad error for file /opt/firefox/libxul.so:
libfreetype.so.6: cannot open shared object file: No such file or directory
Couldn't load XPCOM.

Thanks in advance.

2 Answers

Alex Dunn helped me, you can install Firefox 28 or 50.x with apt-get, so downloading it needs some dependencies, here's the Docker file:

RUN apt-get update
RUN apt-get purge firefox
RUN apt-cache showpkg firefox
RUN apt-get install -y wget libfreetype6 libfontconfig1 libxrender1 libXext6 libXdamage1 libXfixes-dev libXcomposite-dev libasound-dev libdbus-glib-1-dev libgtk2.0-0 libxt6 python-pip
RUN pip install selenium==2.48.0 robotframework==3.0 requests robotframework-requests robotframework-selenium2library==1.8.0 pymysql robotframework-databaselibrary robotframework-excellibrary
RUN pip install requests --upgrade
RUN wget
RUN tar -xjf firefox-45.0.tar.bz2
RUN mv firefox /opt/firefox45
RUN ln -s /opt/firefox45/firefox /usr/bin/firefox
RUN ls /opt/firefox45
RUN firefox --version
1

As October 2021, I did it this way:

ARG FIREFOX_VERSION=XX.YY.ZZ
RUN apt-get update -qqy \ && apt-get -qqy --no-install-recommends install firefox \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ && wget --no-verbose -O /tmp/firefox.tar.bz2 \ && apt-get -y purge firefox \ && rm -rf /opt/firefox \ && tar -C /opt -xjf /tmp/firefox.tar.bz2 \ && rm /tmp/firefox.tar.bz2 \ && mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \ && ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox

...taking inspiration on the Firefox installation part on the selenium/node-firefox Dockerfile.
It works smoothly with Firefox version 93.0 .

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy