2017-03-06 02:30:51 +01:00
|
|
|
# Run Chromium in a container
|
2014-10-19 06:40:41 +02:00
|
|
|
#
|
2017-03-06 02:30:51 +01:00
|
|
|
# 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 \
|
|
|
|
# -v $HOME/Downloads:/home/chromium/Downloads \
|
|
|
|
# -v $HOME/.config/chromium/:/data \ # if you want to save state
|
|
|
|
# --security-opt seccomp=$HOME/chrome.json \
|
|
|
|
# --device /dev/snd \ # so we have sound
|
|
|
|
# -v /dev/shm:/dev/shm \
|
|
|
|
# --name chromium \
|
|
|
|
# jess/chromium
|
2014-10-19 06:40:41 +02:00
|
|
|
#
|
2017-03-06 02:30:51 +01:00
|
|
|
# You will want the custom seccomp profile:
|
|
|
|
# wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json
|
2014-10-19 06:40:41 +02:00
|
|
|
|
|
|
|
# Base docker image
|
2018-12-18 19:09:13 +01:00
|
|
|
FROM debian:sid-slim
|
2017-03-09 19:14:37 +01:00
|
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
2014-10-19 06:40:41 +02:00
|
|
|
|
|
|
|
# Install Chromium
|
2017-03-06 02:30:51 +01:00
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
chromium \
|
|
|
|
chromium-l10n \
|
|
|
|
fonts-liberation \
|
|
|
|
fonts-roboto \
|
|
|
|
hicolor-icon-theme \
|
|
|
|
libcanberra-gtk-module \
|
|
|
|
libexif-dev \
|
|
|
|
libgl1-mesa-dri \
|
|
|
|
libgl1-mesa-glx \
|
|
|
|
libpango1.0-0 \
|
|
|
|
libv4l-0 \
|
|
|
|
fonts-symbola \
|
|
|
|
--no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& mkdir -p /etc/chromium.d/ \
|
2018-03-24 00:58:57 +01:00
|
|
|
&& /bin/echo -e 'export GOOGLE_API_KEY="AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"\nexport GOOGLE_DEFAULT_CLIENT_ID="811574891467.apps.googleusercontent.com"\nexport GOOGLE_DEFAULT_CLIENT_SECRET="kdloedMFGdGla2P1zacGjAQh"' > /etc/chromium.d/googleapikeys
|
|
|
|
|
|
|
|
# Download the google-talkplugin
|
|
|
|
RUN buildDeps=' \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
' \
|
|
|
|
&& set -x \
|
|
|
|
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
|
|
|
|
&& 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 \
|
|
|
|
&& apt-get purge -y --auto-remove $buildDeps
|
2017-03-06 02:30:51 +01:00
|
|
|
|
|
|
|
# Add chromium user
|
|
|
|
RUN groupadd -r chromium && useradd -r -g chromium -G audio,video chromium \
|
|
|
|
&& mkdir -p /home/chromium/Downloads && chown -R chromium:chromium /home/chromium
|
|
|
|
|
|
|
|
# Run as non privileged user
|
|
|
|
USER chromium
|
2014-10-19 06:40:41 +02:00
|
|
|
|
2015-06-06 03:10:14 +02:00
|
|
|
ENTRYPOINT [ "/usr/bin/chromium" ]
|
2015-08-23 02:05:15 +02:00
|
|
|
CMD [ "--user-data-dir=/data" ]
|