Git Product home page Git Product logo

chrome-headless's Introduction

Headless Google Chrome

This docker image uses the Google Chrome stable channel that introduced headless execution with version 59.

There are currently two feasible options to run Chrome inside Docker:

  • Specify a Docker security profile that allows the Chrome sandbox (docker run --security-opt seccomp=chrome.json)
    • Jess Frazelle (@jessfraz) has created such a profile for Chrome
  • Disable the Chrome sandbox (google-chrome --no-sandbox)
    • This lowers the security of Chrome and is not recommended when browsing untrusted web content

Examples

Security Profile

Download @jessfraz Docker security profile for Chrome:

wget https://raw.githubusercontent.com/jessfraz/dotfiles/master/etc/docker/seccomp/chrome.json

Browse to Google and save a screenshot to the current directory:

docker run --rm --security-opt seccomp=chrome.json -v $PWD:/data armbues/chrome-headless --screenshot http://www.google.com

Start Chrome with the remote debugging port running on 9222 and map it to the host:

docker run --rm -d --security-opt seccomp=chrome.json -p 9222:9222 armbues/chrome-headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222

Disabled Chrome sandbox

Browse to Google and save a screenshot to the current directory:

docker run --rm -v $PWD:/data armbues/chrome-headless --no-sandbox --screenshot http://www.google.com

Start Chrome with the remote debugging port running on 9222 and map it to the host:

docker run --rm -d -p 9222:9222 armbues/chrome-headless --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222

chrome-headless's People

Contributors

armbues avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.