Skip to content

Instantly share code, notes, and snippets.

@imduffy15
Created April 10, 2020 09:40
Show Gist options
  • Save imduffy15/053f771fa986e932171494ee459eaa47 to your computer and use it in GitHub Desktop.
Save imduffy15/053f771fa986e932171494ee459eaa47 to your computer and use it in GitHub Desktop.
FROM debian:buster-slim
# Install Chrome
RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& apt-add-repository contrib \
&& apt-get update \
&& apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
hicolor-icon-theme \
libcanberra-gtk* \
libgl1-mesa-dri \
libgl1-mesa-glx \
libpango1.0-0 \
libpulse0 \
libv4l-0 \
fonts-symbola \
--no-install-recommends \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \
&& apt-get update && apt-get install -y \
google-chrome-stable \
--no-install-recommends \
&& echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections \
&& apt-get install --no-install-recommends -y \
ttf-mscorefonts-installer \
fonts-liberation \
ttf-wqy-zenhei \
fonts-arphic-gbsn00lp \
fonts-arphic-bsmi00lp \
fonts-arphic-gkai00mp \
fonts-arphic-bkai00mp \
fonts-beng \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \
&& mkdir -p /home/chrome/Downloads /home/chrome/.config/google-chrome && chown -R chrome:chrome /home/chrome
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
USER chrome
EXPOSE 9222
COPY local.conf /etc/fonts/local.conf
ENTRYPOINT ["/tini", "--", "google-chrome"]
CMD ["google-chrome", \
"--disable-background-timer-throttling", \
"--disable-breakpad", \
"--disable-client-side-phishing-detection", \
"--disable-cloud-import", \
"--disable-default-apps", \
"--disable-dev-shm-usage", \
"--disable-extensions", \
"--disable-gesture-typing", \
"--disable-gpu", \
"--disable-hang-monitor", \
"--disable-infobars", \
"--disable-notifications", \
"--disable-offer-store-unmasked-wallet-cards", \
"--disable-offer-upload-credit-cards", \
"--disable-popup-blocking", \
"--disable-print-preview", \
"--disable-prompt-on-repost", \
"--disable-setuid-sandbox", \
"--disable-speech-api", \
"--disable-sync", \
"--disable-tab-for-desktop-share", \
"--disable-translate", \
"--disable-voice-input", \
"--disable-wake-on-wifi", \
"--enable-async-dns", \
"--enable-simple-cache-backend", \
"--enable-tcp-fast-open", \
"--enable-webgl", \
"--headless", \
"--hide-scrollbars", \
"--ignore-certificate-errors", \
"--ignore-certificate-errors-spki-list", \
"--ignore-gpu-blacklist", \
"--media-cache-size=33554432", \
"--metrics-recording-only", \
"--mute-audio", \
"--no-default-browser-check", \
"--no-first-run", \
"--no-pings", \
"--no-sandbox", \
"--password-store=basic", \
"--prerender-from-omnibox=disabled", \
"--remote-debugging-address=0.0.0.0", \
"--remote-debugging-port=9222", \
"--safebrowsing-disable-auto-update", \
"--use-gl=swiftshader", \
"--use-mock-keychain", \
"--user-data-dir=/home/chrome/.config/google-chrome", \
"--window-position=0,0", \
"--window-size=1024x768", \
"-no-pings"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment