now is based on Ubuntu Xenial; Firefox to 46.0 and Java RE to 1.8.0_91; updated the doc
This commit is contained in:
parent
a02fa4cd0c
commit
a8188772a8
92
Dockerfile
92
Dockerfile
@ -1,41 +1,40 @@
|
|||||||
# Run Firefox in a container
|
FROM ubuntu:xenial
|
||||||
|
|
||||||
FROM debian:jessie
|
|
||||||
MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>
|
MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>
|
||||||
|
|
||||||
# To avoid problems with Dialog and curses wizards
|
# To avoid problems with Dialog and curses wizards
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
# -- Install the prerequisites
|
# Keep the image updated and install the dependencies
|
||||||
RUN sed -i.bak 's/jessie main/jessie main contrib/g' /etc/apt/sources.list \
|
RUN apt-get update && \
|
||||||
&& apt-get update \
|
apt-get -y upgrade && \
|
||||||
&& apt-get install -yq bzip2 libfreetype6 libfontconfig1 \
|
apt-get -y dist-upgrade && \
|
||||||
libxrender1 libxext6 libxdamage1 libxcomposite1 libasound2 \
|
apt-get -fy install && \
|
||||||
libdbus-glib-1-2 libgtk2.0-0 libxt6 libcanberra-gtk-module \
|
apt-get -y install bzip2 libgtk-3-0 libdbus-glib-1-2 libxt6 \
|
||||||
libv4l-0 \
|
libasound2 libgtk2.0-0 libpango1.0-0 libv4l-0 \
|
||||||
libpango1.0-0 \
|
pulseaudio && \
|
||||||
pulseaudio \
|
rm -rf /var/lib/apt/lists
|
||||||
fonts-droid fonts-freefont-ttf \
|
|
||||||
&& rm -rf /var/lib/apt/lists
|
|
||||||
|
|
||||||
# -- The Firefox
|
# Obtain the Mozilla Firefox
|
||||||
ENV FIREFOX_VER 45.0.2
|
# Deps: bzip2 libgtk-3-0 libdbus-glib-1-2 libxt6
|
||||||
|
ENV FIREFOX_VER 46.0
|
||||||
ADD https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VER/linux-x86_64/en-US/firefox-$FIREFOX_VER.tar.bz2 /tmp/firefox.tar.bz2
|
ADD https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VER/linux-x86_64/en-US/firefox-$FIREFOX_VER.tar.bz2 /tmp/firefox.tar.bz2
|
||||||
RUN mkdir /opt/mozilla \
|
RUN mkdir /opt/mozilla && \
|
||||||
&& tar xf /tmp/firefox.tar.bz2 -C /opt/mozilla/ \
|
tar xf /tmp/firefox.tar.bz2 -C /opt/mozilla/ && \
|
||||||
&& rm -f /tmp/firefox.tar.bz2
|
rm -f /tmp/firefox.tar.bz2
|
||||||
|
|
||||||
# -- Google Hangouts
|
# Google Hangouts
|
||||||
|
# Deps: libasound2 libgtk2.0-0 libpango1.0-0 libv4l-0
|
||||||
ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /tmp/google-talkplugin_current_amd64.deb
|
ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /tmp/google-talkplugin_current_amd64.deb
|
||||||
RUN dpkg -i /tmp/google-talkplugin_current_amd64.deb \
|
RUN dpkg -i /tmp/google-talkplugin_current_amd64.deb && \
|
||||||
&& rm -f /tmp/google-talkplugin_current_amd64.deb
|
rm -f /tmp/google-talkplugin_current_amd64.deb
|
||||||
|
|
||||||
# -- Java x64 RE plugin
|
# Java x64 RE plugin
|
||||||
# https://java.com/en/download/manual.jsp
|
# https://java.com/en/download/manual.jsp
|
||||||
# https://www.java.com/verify
|
# https://www.java.com/verify
|
||||||
ENV JAVA_VER 8
|
ENV JAVA_VER 8
|
||||||
ENV JAVA_JRE_UVER 77
|
ENV JAVA_JRE_UVER 91
|
||||||
ENV JAVA_JRE_FVER 1.8.0_77
|
ENV JAVA_JRE_FVER 1.8.0_91
|
||||||
|
ENV JAVA_BUNDLE_ID 207765
|
||||||
ENV JAVA_FONTS "/usr/share/fonts/truetype"
|
ENV JAVA_FONTS "/usr/share/fonts/truetype"
|
||||||
ENV _JAVA_OPTIONS "-Dawt.useSystemAAFontSettings=on \
|
ENV _JAVA_OPTIONS "-Dawt.useSystemAAFontSettings=on \
|
||||||
-Dswing.aatext=true \
|
-Dswing.aatext=true \
|
||||||
@ -48,36 +47,31 @@ ENV _JAVA_OPTIONS "-Dawt.useSystemAAFontSettings=on \
|
|||||||
# - javax.swing.plaf.nimbus.NimbusLookAndFeel
|
# - javax.swing.plaf.nimbus.NimbusLookAndFeel
|
||||||
# - com.sun.java.swing.plaf.gtk.GTKLookAndFeel
|
# - com.sun.java.swing.plaf.gtk.GTKLookAndFeel
|
||||||
# - com.sun.java.swing.plaf.motif.MotifLookAndFeel
|
# - com.sun.java.swing.plaf.motif.MotifLookAndFeel
|
||||||
ADD http://javadl.sun.com/webapps/download/AutoDL?BundleId=207221 /tmp/jre-linux-x64.tar.gz
|
ADD http://javadl.sun.com/webapps/download/AutoDL?BundleId=$JAVA_BUNDLE_ID /tmp/jre-linux-x64.tar.gz
|
||||||
RUN mkdir -p /opt/java/64 \
|
RUN mkdir -p /opt/java/64 && \
|
||||||
&& tar xf /tmp/jre-linux-x64.tar.gz -C /opt/java/64/ \
|
tar xf /tmp/jre-linux-x64.tar.gz -C /opt/java/64/ && \
|
||||||
&& cd /opt/java/64/ \
|
cd /opt/java/64/ && \
|
||||||
&& ln -sv jre${JAVA_JRE_FVER} jre \
|
ln -sv jre${JAVA_JRE_FVER} jre && \
|
||||||
&& ln -sv /opt/java/64/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins/ \
|
ln -sv /opt/java/64/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins/ && \
|
||||||
&& update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre/bin/java" 1 \
|
update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre/bin/java" 1 && \
|
||||||
&& update-alternatives --set java /opt/java/64/jre/bin/java \
|
update-alternatives --set java /opt/java/64/jre/bin/java && \
|
||||||
&& update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/java/64/jre/bin/javaws" 1 \
|
update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/java/64/jre/bin/javaws" 1 && \
|
||||||
&& update-alternatives --set javaws /opt/java/64/jre/bin/javaws \
|
update-alternatives --set javaws /opt/java/64/jre/bin/javaws && \
|
||||||
&& rm -f /tmp/jre-linux-x64.tar.gz
|
rm -f /tmp/jre-linux-x64.tar.gz
|
||||||
|
|
||||||
# For testing the audio
|
# Workaround: pulseaudio client library likes to remove /dev/shm/pulse-shm-*
|
||||||
# docker-compose run --rm --entrypoint /bin/bash firefox
|
# files created by the host, causing sound to stop working.
|
||||||
# aplay -L
|
# To fix this, we either want to disable the shm or mount /dev/shm
|
||||||
# pactl list
|
# in read-only mode when starting the container.
|
||||||
# arecord -D pulse -f cd | aplay -D pulse -B 10000 -
|
RUN echo "enable-shm = no" >> /etc/pulse/client.conf
|
||||||
# RUN apt-get update && apt-get install -y alsa-utils
|
|
||||||
#
|
|
||||||
# WebRTC online test for Microphone, Camera, Network, Connectivity and Throughput
|
|
||||||
# https://test.webrtc.org/
|
|
||||||
# https://webaudiodemos.appspot.com/AudioRecorder/index.html
|
|
||||||
|
|
||||||
# -- Define a user under which the firefox will be running
|
# Define a user under which the Firefox will be running
|
||||||
ENV USER user
|
ENV USER user
|
||||||
ENV UID 1000
|
ENV UID 1000
|
||||||
ENV GROUPS video,audio
|
ENV GROUPS video,audio
|
||||||
ENV HOME /home/$USER
|
ENV HOME /home/$USER
|
||||||
RUN useradd -u $UID -m -d $HOME -s /usr/sbin/nologin $USER \
|
RUN useradd -u $UID -m -d $HOME -s /usr/sbin/nologin $USER && \
|
||||||
&& usermod -aG $GROUPS $USER
|
usermod -aG $GROUPS $USER
|
||||||
|
|
||||||
WORKDIR $HOME
|
WORKDIR $HOME
|
||||||
USER $USER
|
USER $USER
|
||||||
|
58
README.md
58
README.md
@ -1,22 +1,36 @@
|
|||||||
Readme
|
# Firefox in Docker
|
||||||
======
|
|
||||||
|
## Launching the Firefox
|
||||||
|
|
||||||
Launching the firefox
|
|
||||||
```
|
```
|
||||||
docker-compose up -d
|
alias firefox="docker-compose -f ~/docker/firefox/docker-compose.yml run --rm firefox"
|
||||||
```
|
```
|
||||||
|
|
||||||
Extensions
|
# Troubleshooting
|
||||||
==========
|
|
||||||
|
## Audio
|
||||||
|
|
||||||
|
Following are some useful commands which you can use for testing the audio
|
||||||
|
|
||||||
I have decided to add here a list of the Firefox's extensions I am using
|
|
||||||
```
|
```
|
||||||
https://www.eff.org/privacybadger
|
docker-compose run --rm --entrypoint /bin/bash firefox
|
||||||
https://adblockultimate.net/
|
apt-get update && apt-get install -y alsa-utils
|
||||||
|
aplay -L
|
||||||
|
pactl list
|
||||||
|
cat /dev/urandom | aplay -
|
||||||
|
arecord -D pulse -f cd | aplay -D pulse -B 10000 -
|
||||||
|
|
||||||
|
WebRTC online test for Microphone, Camera, Network, Connectivity and Throughput
|
||||||
|
https://test.webrtc.org/
|
||||||
|
https://webaudiodemos.appspot.com/AudioRecorder/index.html
|
||||||
```
|
```
|
||||||
|
|
||||||
Extra
|
## Video
|
||||||
=====
|
|
||||||
|
Go to `about:support` in the Firefox to see whether everything is OK or not.
|
||||||
|
|
||||||
|
|
||||||
|
## Codecs and the HW acceleration
|
||||||
|
|
||||||
You may want to disable Google's VP8 & VP9 video codecs: "MSE & WebM VP9" and "WebM VP8"
|
You may want to disable Google's VP8 & VP9 video codecs: "MSE & WebM VP9" and "WebM VP8"
|
||||||
as there is no hardware decoding for them.
|
as there is no hardware decoding for them.
|
||||||
@ -26,21 +40,19 @@ https://addons.mozilla.org/en-us/firefox/addon/h264ify/
|
|||||||
```
|
```
|
||||||
|
|
||||||
Check the codecs
|
Check the codecs
|
||||||
|
|
||||||
```
|
```
|
||||||
https://www.youtube.com/html5
|
https://www.youtube.com/html5
|
||||||
```
|
```
|
||||||
|
|
||||||
To initialize the new Firefox profile
|
|
||||||
|
# Extra
|
||||||
|
|
||||||
|
## Extensions
|
||||||
|
|
||||||
|
Here is the list of Firefox's extensions I am using
|
||||||
|
|
||||||
```
|
```
|
||||||
docker-compose run --rm firefox -P
|
https://www.eff.org/privacybadger
|
||||||
|
https://adblockultimate.net/
|
||||||
```
|
```
|
||||||
|
|
||||||
Limitations
|
|
||||||
===========
|
|
||||||
|
|
||||||
X11 and PulseAudio
|
|
||||||
------------------
|
|
||||||
|
|
||||||
The user ID must match the ID of a user that runs the container,
|
|
||||||
otherwise X neither audio will work.
|
|
||||||
|
|
||||||
|
@ -3,33 +3,24 @@ version: '2'
|
|||||||
volumes:
|
volumes:
|
||||||
data: {}
|
data: {}
|
||||||
|
|
||||||
networks:
|
|
||||||
isolated:
|
|
||||||
external:
|
|
||||||
name: isolated
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
firefox:
|
firefox:
|
||||||
read_only: true
|
read_only: true
|
||||||
image: andrey01/firefox
|
image: andrey01/firefox
|
||||||
networks:
|
network_mode: bridge
|
||||||
- isolated
|
|
||||||
devices:
|
devices:
|
||||||
- /dev/dri
|
- /dev/dri
|
||||||
- /dev/video0
|
- /dev/video0
|
||||||
volumes:
|
volumes:
|
||||||
|
- /dev/shm:/dev/shm:ro
|
||||||
- /tmp/.X11-unix:/tmp/.X11-unix:ro
|
- /tmp/.X11-unix:/tmp/.X11-unix:ro
|
||||||
- /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/engines:/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/engines:ro
|
|
||||||
- /usr/share/themes:/usr/share/themes:ro
|
|
||||||
- /usr/share/icons:/usr/share/icons:ro
|
|
||||||
- /var/run/cups:/var/run/cups:ro
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- /etc/machine-id:/etc/machine-id:ro
|
- /etc/machine-id:/etc/machine-id:ro
|
||||||
- /run/user/1000/pulse:/run/user/1000/pulse
|
- $XDG_RUNTIME_DIR/pulse:/run/user/1000/pulse
|
||||||
- /dev/shm:/dev/shm:ro
|
- /var/run/cups:/var/run/cups:ro
|
||||||
# - /tmp/krb5cc_1000:/tmp/krb5cc_1000:ro
|
|
||||||
- data:/home/user
|
- data:/home/user
|
||||||
- $HOME/Downloads:/home/user/Downloads
|
- $HOME/Downloads:/home/user/Downloads
|
||||||
|
# - /tmp/krb5cc_1000:/tmp/krb5cc_1000:ro
|
||||||
environment:
|
environment:
|
||||||
- DISPLAY=unix$DISPLAY
|
- DISPLAY=unix$DISPLAY
|
||||||
- PULSE_SERVER=unix:/run/user/1000/pulse/native
|
- PULSE_SERVER=unix:$XDG_RUNTIME_DIR/pulse/native
|
||||||
|
Loading…
Reference in New Issue
Block a user