refactored
This commit is contained in:
parent
20a2f0b280
commit
edafab9f51
15
Dockerfile
15
Dockerfile
@ -13,8 +13,8 @@ RUN sed -i.bak 's/jessie main/jessie main contrib/g' /etc/apt/sources.list \
|
|||||||
libxrender1 libxext6 libxdamage1 libxcomposite1 libasound2 \
|
libxrender1 libxext6 libxdamage1 libxcomposite1 libasound2 \
|
||||||
libdbus-glib-1-2 libgtk2.0-0 libxt6 libcanberra-gtk-module \
|
libdbus-glib-1-2 libgtk2.0-0 libxt6 libcanberra-gtk-module \
|
||||||
libv4l-0 \
|
libv4l-0 \
|
||||||
pulseaudio \
|
|
||||||
libpango1.0-0 \
|
libpango1.0-0 \
|
||||||
|
pulseaudio \
|
||||||
fonts-droid fonts-freefont-ttf \
|
fonts-droid fonts-freefont-ttf \
|
||||||
&& rm -rf /var/lib/apt/lists
|
&& rm -rf /var/lib/apt/lists
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ RUN mkdir -p /opt/java/64 \
|
|||||||
&& rm -f /tmp/jre-linux-x64.tar.gz
|
&& rm -f /tmp/jre-linux-x64.tar.gz
|
||||||
|
|
||||||
# -- Define a user under which the firefox will be running
|
# -- Define a user under which the firefox will be running
|
||||||
ENV USER firefox
|
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
|
||||||
@ -71,15 +71,4 @@ RUN useradd -u $UID -m -d $HOME -s /usr/sbin/nologin $USER \
|
|||||||
WORKDIR $HOME
|
WORKDIR $HOME
|
||||||
USER $USER
|
USER $USER
|
||||||
|
|
||||||
# Allow write to the following directories when the container starts in
|
|
||||||
# in readonly mode
|
|
||||||
RUN mkdir -p $HOME/.cache \
|
|
||||||
$HOME/.config \
|
|
||||||
$HOME/.local \
|
|
||||||
$HOME/.java
|
|
||||||
VOLUME [ "$HOME/.cache", \
|
|
||||||
"$HOME/.config", \
|
|
||||||
"$HOME/.local", \
|
|
||||||
"$HOME/.java", \
|
|
||||||
"/tmp" ]
|
|
||||||
ENTRYPOINT [ "/opt/mozilla/firefox/firefox" ]
|
ENTRYPOINT [ "/opt/mozilla/firefox/firefox" ]
|
||||||
|
@ -1,9 +1,27 @@
|
|||||||
version: '2'
|
version: '2'
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
data: {}
|
||||||
|
|
||||||
|
networks:
|
||||||
|
isolated:
|
||||||
|
external:
|
||||||
|
name: isolated
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
preseed:
|
||||||
|
# host2docker
|
||||||
|
# this will create a data volume and then copy user's firefox profile data
|
||||||
|
# when the data volume is empty
|
||||||
|
image: busybox
|
||||||
|
network_mode: bridge
|
||||||
|
volumes:
|
||||||
|
- $HOME/.mozilla:/source
|
||||||
|
- data:/target
|
||||||
|
command: /bin/sh -c "[ -d "firefox" ] || (( cd /source && tar cf - . ) | ( cd /target; tar xfp - ))"
|
||||||
|
|
||||||
firefox:
|
firefox:
|
||||||
build: ./
|
build: ./
|
||||||
read_only: true
|
|
||||||
networks:
|
networks:
|
||||||
- isolated
|
- isolated
|
||||||
devices:
|
devices:
|
||||||
@ -14,16 +32,14 @@ services:
|
|||||||
- /usr/share/themes:/usr/share/themes:ro
|
- /usr/share/themes:/usr/share/themes:ro
|
||||||
- /usr/share/icons:/usr/share/icons:ro
|
- /usr/share/icons:/usr/share/icons:ro
|
||||||
- /var/run/cups:/var/run/cups:ro
|
- /var/run/cups:/var/run/cups:ro
|
||||||
# - /tmp/krb5cc_1000:/tmp/krb5cc_1000: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
|
- /run/user/1000/pulse:/run/user/1000/pulse
|
||||||
- $HOME/.mozilla:/home/firefox/.mozilla
|
# - /tmp/krb5cc_1000:/tmp/krb5cc_1000:ro
|
||||||
- $HOME/Downloads:/home/firefox/Downloads
|
# - $HOME/.mozilla:/home/firefox/.mozilla
|
||||||
|
- data:/home/user/.mozilla
|
||||||
|
- $HOME/Downloads:/home/user/Downloads
|
||||||
environment:
|
environment:
|
||||||
DISPLAY: unix$DISPLAY
|
DISPLAY: unix$DISPLAY
|
||||||
|
depends_on:
|
||||||
networks:
|
- preseed
|
||||||
isolated:
|
|
||||||
external:
|
|
||||||
name: isolated
|
|
||||||
|
Loading…
Reference in New Issue
Block a user