2016-04-05 19:12:37 +02:00
|
|
|
# Run Chrome in a container
|
|
|
|
#
|
|
|
|
# docker run -it \
|
|
|
|
# --net host \ # may as well YOLO
|
|
|
|
# --cpuset-cpus 0 \ # control the cpu
|
|
|
|
# --memory 512mb \ # max memory it can use
|
|
|
|
# -v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket
|
|
|
|
# -e DISPLAY=unix$DISPLAY \
|
2017-02-27 00:50:51 +01:00
|
|
|
# -v $HOME/Downloads:/home/chrome/Downloads \
|
2016-04-05 19:12:37 +02:00
|
|
|
# -v $HOME/.config/google-chrome/:/data \ # if you want to save state
|
2017-03-06 02:30:51 +01:00
|
|
|
# --security-opt seccomp=$HOME/chrome.json \
|
2016-04-05 19:12:37 +02:00
|
|
|
# --device /dev/snd \ # so we have sound
|
2018-01-09 19:20:49 +01:00
|
|
|
# --device /dev/dri \
|
2016-04-05 19:12:37 +02:00
|
|
|
# -v /dev/shm:/dev/shm \
|
|
|
|
# --name chrome \
|
|
|
|
# jess/chrome:beta
|
|
|
|
#
|
2017-02-27 00:50:51 +01:00
|
|
|
# You will want the custom seccomp profile:
|
2017-03-06 02:30:51 +01:00
|
|
|
# wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json
|
2016-04-05 19:12:37 +02:00
|
|
|
|
2015-02-16 20:42:48 +01:00
|
|
|
# Base docker image
|
2016-04-05 19:12:37 +02:00
|
|
|
FROM debian:sid
|
2017-03-09 19:14:37 +01:00
|
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
2015-02-16 20:42:48 +01:00
|
|
|
|
2015-07-27 02:44:08 +02:00
|
|
|
ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /src/google-talkplugin_current_amd64.deb
|
2015-02-16 20:42:48 +01:00
|
|
|
|
2016-03-19 21:52:29 +01:00
|
|
|
# Install Chrome
|
2016-10-25 23:02:21 +02:00
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
apt-transport-https \
|
2015-06-05 19:24:11 +02:00
|
|
|
ca-certificates \
|
2016-04-05 19:12:37 +02:00
|
|
|
curl \
|
2016-08-12 04:02:34 +02:00
|
|
|
gnupg \
|
2015-06-05 19:24:11 +02:00
|
|
|
hicolor-icon-theme \
|
2018-03-24 00:58:57 +01:00
|
|
|
libcanberra-gtk* \
|
2015-06-05 19:24:11 +02:00
|
|
|
libgl1-mesa-dri \
|
|
|
|
libgl1-mesa-glx \
|
2017-05-12 16:39:58 +02:00
|
|
|
libpango1.0-0 \
|
2016-08-12 00:43:41 +02:00
|
|
|
libpulse0 \
|
2015-06-05 19:24:11 +02:00
|
|
|
libv4l-0 \
|
2016-02-04 20:34:12 +01:00
|
|
|
fonts-symbola \
|
2016-04-05 19:12:37 +02:00
|
|
|
--no-install-recommends \
|
|
|
|
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
2016-10-25 23:02:21 +02:00
|
|
|
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \
|
2016-04-05 19:12:37 +02:00
|
|
|
&& apt-get update && apt-get install -y \
|
|
|
|
google-chrome-beta \
|
|
|
|
--no-install-recommends \
|
|
|
|
&& apt-get purge --auto-remove -y curl \
|
2018-03-24 00:58:57 +01:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2015-02-16 20:42:48 +01:00
|
|
|
|
2018-03-24 00:58:57 +01:00
|
|
|
# Download the google-talkplugin
|
2018-04-04 16:46:22 +02:00
|
|
|
RUN set -x \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
2018-03-24 00:58:57 +01:00
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& curl -sSL "https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb" -o /tmp/google-talkplugin-amd64.deb \
|
|
|
|
&& dpkg -i /tmp/google-talkplugin-amd64.deb \
|
|
|
|
&& rm -rf /tmp/*.deb \
|
2018-04-04 16:46:22 +02:00
|
|
|
&& apt-get purge -y --auto-remove curl
|
2018-03-24 00:59:41 +01:00
|
|
|
|
2017-02-27 00:50:51 +01:00
|
|
|
# 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
|
|
|
|
|
2015-02-16 20:42:48 +01:00
|
|
|
COPY local.conf /etc/fonts/local.conf
|
|
|
|
|
2017-02-27 00:50:51 +01:00
|
|
|
# Run Chrome as non privileged user
|
|
|
|
USER chrome
|
|
|
|
|
2015-04-16 05:36:00 +02:00
|
|
|
# Autorun chrome
|
2016-04-05 19:12:37 +02:00
|
|
|
ENTRYPOINT [ "google-chrome" ]
|
2015-08-23 02:05:15 +02:00
|
|
|
CMD [ "--user-data-dir=/data" ]
|