a little refactoring

This commit is contained in:
Andy 2016-04-30 11:53:23 +02:00
parent f20dc01500
commit cc535431f0
Signed by: arno
GPG Key ID: 368DDA2E9A471EAC
2 changed files with 19 additions and 17 deletions

View File

@ -18,15 +18,17 @@ RUN apt-get update && \
# Deps: bzip2 libgtk-3-0 libdbus-glib-1-2 libxt6 # Deps: bzip2 libgtk-3-0 libdbus-glib-1-2 libxt6
ENV FIREFOX_VER 46.0 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 cd /tmp && \
tar xf /tmp/firefox.tar.bz2 -C /opt/mozilla/ && \ mkdir /opt/mozilla && \
rm -f /tmp/firefox.tar.bz2 tar xf firefox.tar.bz2 -C /opt/mozilla/ && \
rm -f firefox.tar.bz2
# Google Hangouts # Google Hangouts
# Deps: libasound2 libgtk2.0-0 libpango1.0-0 libv4l-0 # 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.deb
RUN dpkg -i /tmp/google-talkplugin_current_amd64.deb && \ RUN cd /tmp && \
rm -f /tmp/google-talkplugin_current_amd64.deb dpkg -i google-talkplugin.deb && \
rm -f google-talkplugin.deb
# Java x64 RE plugin # Java x64 RE plugin
# https://java.com/en/download/manual.jsp # https://java.com/en/download/manual.jsp
@ -47,9 +49,9 @@ 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=$JAVA_BUNDLE_ID /tmp/jre-linux-x64.tar.gz ADD http://javadl.sun.com/webapps/download/AutoDL?BundleId=$JAVA_BUNDLE_ID /tmp/jre.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.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/ && \
@ -57,7 +59,7 @@ RUN mkdir -p /opt/java/64 && \
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.tar.gz
# Workaround: pulseaudio client library likes to remove /dev/shm/pulse-shm-* # Workaround: pulseaudio client library likes to remove /dev/shm/pulse-shm-*
# files created by the host, causing sound to stop working. # files created by the host, causing sound to stop working.
@ -70,11 +72,12 @@ 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 -G $GROUPS $USER
usermod -aG $GROUPS $USER
WORKDIR $HOME
USER $USER USER $USER
WORKDIR $HOME
# Java JRE requires /tmp directory to be writable
VOLUME [ "/tmp" ] VOLUME [ "/tmp" ]
ENTRYPOINT [ "/opt/mozilla/firefox/firefox" ] ENTRYPOINT [ "/opt/mozilla/firefox/firefox" ]

View File

@ -5,21 +5,20 @@ volumes:
services: services:
firefox: firefox:
read_only: true # docker build -t andrey01/firefox .
image: andrey01/firefox image: andrey01/firefox
read_only: true
network_mode: bridge network_mode: bridge
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
- /etc/localtime:/etc/localtime:ro
- /etc/machine-id:/etc/machine-id:ro
- $XDG_RUNTIME_DIR/pulse:/run/user/1000/pulse - $XDG_RUNTIME_DIR/pulse:/run/user/1000/pulse
- /var/run/cups:/var/run/cups:ro - /dev/shm:/dev/shm:ro
- data:/home/user - data:/home/user
- $HOME/Downloads:/home/user/Downloads - $HOME/Downloads:/home/user/Downloads
- /var/run/cups:/var/run/cups:ro
# - /tmp/krb5cc_1000:/tmp/krb5cc_1000:ro # - /tmp/krb5cc_1000:/tmp/krb5cc_1000:ro
environment: environment:
- DISPLAY=unix$DISPLAY - DISPLAY=unix$DISPLAY