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 \
|
||||
libdbus-glib-1-2 libgtk2.0-0 libxt6 libcanberra-gtk-module \
|
||||
libv4l-0 \
|
||||
pulseaudio \
|
||||
libpango1.0-0 \
|
||||
pulseaudio \
|
||||
fonts-droid fonts-freefont-ttf \
|
||||
&& rm -rf /var/lib/apt/lists
|
||||
|
||||
@ -61,7 +61,7 @@ RUN mkdir -p /opt/java/64 \
|
||||
&& rm -f /tmp/jre-linux-x64.tar.gz
|
||||
|
||||
# -- Define a user under which the firefox will be running
|
||||
ENV USER firefox
|
||||
ENV USER user
|
||||
ENV UID 1000
|
||||
ENV GROUPS video,audio
|
||||
ENV HOME /home/$USER
|
||||
@ -71,15 +71,4 @@ RUN useradd -u $UID -m -d $HOME -s /usr/sbin/nologin $USER \
|
||||
WORKDIR $HOME
|
||||
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" ]
|
||||
|
@ -1,9 +1,27 @@
|
||||
version: '2'
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
|
||||
networks:
|
||||
isolated:
|
||||
external:
|
||||
name: isolated
|
||||
|
||||
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:
|
||||
build: ./
|
||||
read_only: true
|
||||
networks:
|
||||
- isolated
|
||||
devices:
|
||||
@ -14,16 +32,14 @@ services:
|
||||
- /usr/share/themes:/usr/share/themes:ro
|
||||
- /usr/share/icons:/usr/share/icons:ro
|
||||
- /var/run/cups:/var/run/cups:ro
|
||||
# - /tmp/krb5cc_1000:/tmp/krb5cc_1000:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/machine-id:/etc/machine-id:ro
|
||||
- /run/user/1000/pulse:/run/user/1000/pulse
|
||||
- $HOME/.mozilla:/home/firefox/.mozilla
|
||||
- $HOME/Downloads:/home/firefox/Downloads
|
||||
# - /tmp/krb5cc_1000:/tmp/krb5cc_1000:ro
|
||||
# - $HOME/.mozilla:/home/firefox/.mozilla
|
||||
- data:/home/user/.mozilla
|
||||
- $HOME/Downloads:/home/user/Downloads
|
||||
environment:
|
||||
DISPLAY: unix$DISPLAY
|
||||
|
||||
networks:
|
||||
isolated:
|
||||
external:
|
||||
name: isolated
|
||||
depends_on:
|
||||
- preseed
|
||||
|
Loading…
Reference in New Issue
Block a user