mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 11:31:49 +01:00
cleanup chrome
Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
parent
38fa7f985b
commit
58a9905013
|
@ -6,13 +6,16 @@
|
||||||
# --memory 512mb \ # max memory it can use
|
# --memory 512mb \ # max memory it can use
|
||||||
# -v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket
|
# -v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket
|
||||||
# -e DISPLAY=unix$DISPLAY \
|
# -e DISPLAY=unix$DISPLAY \
|
||||||
# -v $HOME/Downloads:/root/Downloads \
|
# -v $HOME/Downloads:/home/chrome/Downloads \
|
||||||
# -v $HOME/.config/google-chrome/:/data \ # if you want to save state
|
# -v $HOME/.config/google-chrome/:/data \ # if you want to save state
|
||||||
|
# --security-opt seccomp=/etc/docker/seccomp/chrome.json
|
||||||
# --device /dev/snd \ # so we have sound
|
# --device /dev/snd \ # so we have sound
|
||||||
# -v /dev/shm:/dev/shm \
|
# -v /dev/shm:/dev/shm \
|
||||||
# --name chrome \
|
# --name chrome \
|
||||||
# jess/chrome:beta
|
# jess/chrome:beta
|
||||||
#
|
#
|
||||||
|
# You will want the custom seccomp profile:
|
||||||
|
# wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -o ~/chrome.json
|
||||||
|
|
||||||
# Base docker image
|
# Base docker image
|
||||||
FROM debian:sid
|
FROM debian:sid
|
||||||
|
@ -43,8 +46,15 @@ RUN apt-get update && apt-get install -y \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& rm -rf /src/*.deb
|
&& rm -rf /src/*.deb
|
||||||
|
|
||||||
|
# Add chrome user
|
||||||
|
RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \
|
||||||
|
&& mkdir -p /home/chrome/Downloads && chown -R chrome:chrome /home/chrome
|
||||||
|
|
||||||
COPY local.conf /etc/fonts/local.conf
|
COPY local.conf /etc/fonts/local.conf
|
||||||
|
|
||||||
|
# Run Chrome as non privileged user
|
||||||
|
USER chrome
|
||||||
|
|
||||||
# Autorun chrome
|
# Autorun chrome
|
||||||
ENTRYPOINT [ "google-chrome" ]
|
ENTRYPOINT [ "google-chrome" ]
|
||||||
CMD [ "--user-data-dir=/data" ]
|
CMD [ "--user-data-dir=/data" ]
|
||||||
|
|
|
@ -8,13 +8,14 @@
|
||||||
# -e DISPLAY=unix$DISPLAY \
|
# -e DISPLAY=unix$DISPLAY \
|
||||||
# -v $HOME/Downloads:/home/chrome/Downloads \
|
# -v $HOME/Downloads:/home/chrome/Downloads \
|
||||||
# -v $HOME/.config/google-chrome/:/data \ # if you want to save state
|
# -v $HOME/.config/google-chrome/:/data \ # if you want to save state
|
||||||
|
# --security-opt seccomp=/etc/docker/seccomp/chrome.json
|
||||||
# --device /dev/snd \ # so we have sound
|
# --device /dev/snd \ # so we have sound
|
||||||
# -v /dev/shm:/dev/shm \
|
# -v /dev/shm:/dev/shm \
|
||||||
# --name chrome \
|
# --name chrome \
|
||||||
# jess/chrome
|
# jess/chrome
|
||||||
#
|
#
|
||||||
# For Ubuntu I had to add download Jessie's chrome.json.
|
# You will want the custom seccomp profile:
|
||||||
# wget wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -o ~/chrome.json
|
# wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -o ~/chrome.json
|
||||||
|
|
||||||
# Base docker image
|
# Base docker image
|
||||||
FROM debian:sid
|
FROM debian:sid
|
||||||
|
@ -44,12 +45,16 @@ RUN apt-get update && apt-get install -y \
|
||||||
&& apt-get purge --auto-remove -y curl \
|
&& apt-get purge --auto-remove -y curl \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& rm -rf /src/*.deb
|
&& rm -rf /src/*.deb
|
||||||
|
|
||||||
|
# Add chrome user
|
||||||
RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \
|
RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \
|
||||||
&& mkdir -p /home/chrome/Downloads && chown -R chrome:chrome /home/chrome
|
&& mkdir -p /home/chrome/Downloads && chown -R chrome:chrome /home/chrome
|
||||||
|
|
||||||
COPY local.conf /etc/fonts/local.conf
|
COPY local.conf /etc/fonts/local.conf
|
||||||
|
|
||||||
# Run Chrome as non privileged user
|
# Run Chrome as non privileged user
|
||||||
USER chrome
|
USER chrome
|
||||||
|
|
||||||
# Autorun chrome
|
# Autorun chrome
|
||||||
ENTRYPOINT [ "google-chrome" ]
|
ENTRYPOINT [ "google-chrome" ]
|
||||||
CMD [ "--user-data-dir=/data" ]
|
CMD [ "--user-data-dir=/data" ]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user