Following the changes with the Rate Limiting on Docker Hub. Tweet here for more information in 🇫🇷
zenika/alpine-chromeghcr.io/zenika/alpine-chromegcr.io/zenika-hub/alpine-chromeeu.gcr.io/zenika-hub/alpine-chromeasia.gcr.io/zenika-hub/alpine-chromeus.gcr.io/zenika-hub/alpine-chromeDockerfile linkslatest, 100 (Dockerfile)with-node, 100-with-node, 100-with-node-16 (Dockerfile)with-puppeteer, 100-with-puppeteer (Dockerfile)with-playwright, 100-with-playwright (Dockerfile)with-selenoid, 100-with-selenoid (Dockerfile)with-chromedriver, 100-with-chromedriver (Dockerfile)89, 86, 85, 84, 83, 81, 80, 77, 76, 73, 72, 71, 68, 6489-with-node, 86-with-node, 85-with-node, 84-with-node, 83-with-node, 81-with-node, 80-with-node, 77-with-node, 76-with-node89-with-puppeteer, 86-with-puppeteer, 85-with-puppeteer,84-with-puppeteer, 83-with-puppeteer, 81-with-puppeteer, 80-with-puppeteer, 77-with-puppeteer, 76-with-puppeteerChrome running in headless mode in a tiny Alpine image
In the world of webdev, the ability to run quickly end-to-end tests are important. Popular technologies like Puppeteer enable developers to make fun things like testing, automating forms, crawling, generating screenshots, capturing timeline... And there is a secret: some of these features are directly available on Chrome! 🙌
Launching the container using only docker container run -it zenika/alpine-chrome ... will fail with some logs similar to #33.
Please use the 3 others ways to use Chrome Headless.
--no-sandboxLaunch the container using:
docker container run -it --rm zenika/alpine-chrome and use the --no-sandbox flag for all your commands.
Be careful to know the website you're calling.
Explanation for the no-sandbox flag in a quick introduction here and for More in depth design document here
SYS_ADMIN capabilityLaunch the container using:
docker container run -it --rm --cap-add=SYS_ADMIN zenika/alpine-chrome
This allows to run Chrome with sandboxing but needs unnecessary privileges from a Docker point of view.
seccompThanks to ever-awesome Jessie Frazelle seccomp profile for Chrome. This is The most secure way to run this Headless Chrome docker image.
Also available here wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json
Launch the container using:
docker container run -it --rm --security-opt seccomp=$(pwd)/chrome.json zenika/alpine-chrome
The default entrypoint runs chromium-browser --headless with some common flags from CHROMIUM_FLAGS set in the Dockerfile.
You can change the CHROMIUM_FLAGS by overriding the environment variable using: docker container run -it --rm --env CHROMIUM_FLAGS="--other-flag ..." zenika/alpine-chrome chromium-browser ...
You can get full control by overriding the entrypoint using: docker container run -it --rm --entrypoint "" zenika/alpine-chrome chromium-browser ...
Command (with no-sandbox): docker container run -d -p 9222:9222 zenika/alpine-chrome --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 https://www.chromestatus.com/
Open your browser to: http://localhost:9222 and then click on the tab you want to inspect. Replace the beginning
https://chrome-devtools-frontend.appspot.com/serve_file/@.../inspector.html?ws=localhost:9222/[END]
by
chrome-devtools://devtools/bundled/inspector.html?ws=localhost:9222/[END]
Command (with no-sandbox): docker container run -it --rm zenika/alpine-chrome --no-sandbox --dump-dom https://www.chromestatus.com/
Command (with no-sandbox): docker container run -it --rm -v $(pwd):/usr/src/app zenika/alpine-chrome --no-sandbox --print-to-pdf --hide-scrollbars https://www.chromestatus.com/
Command (with no-sandbox): docker container run -it --rm -v $(pwd):/usr/src/app zenika/alpine-chrome --no-sandbox --screenshot --hide-scrollbars https://www.chromestatus.com/
Command (with no-sandbox): docker container run -it --rm -v $(pwd):/usr/src/app zenika/alpine-chrome --no-sandbox --screenshot --hide-scrollbars --window-size=1280,1696 https://www.chromestatus.com/
Command (with no-sandbox): docker container run -it --rm -v $(pwd):/usr/src/app zenika/alpine-chrome --no-sandbox --screenshot --hide-scrollbars --window-size=412,732 https://www.chromestatus.com/
Command (with no-sandbox): docker container run -u `id -u $USER` -it --rm -v $(pwd):/usr/src/app zenika/alpine-chrome --no-sandbox --screenshot --hide-scrollbars --window-size=412,732 https://www.chromestatus.com/
Go the deno src folder. Build your image using this command:
docker image build -t zenika/alpine-chrome:with-deno-sample .
Then launch the container:
docker container run -it --rm zenika/alpine-chrome:with-deno-sample Download https://deno.land/std/examples/welcome.ts Warning Implicitly using master branch https://deno.land/std/examples/welcome.ts Compile https://deno.land/std/examples/welcome.ts Welcome to Deno 🦕
With your own file, use this command:
docker container run -it --rm -v $(pwd):/usr/src/app zenika/alpine-chrome:with-deno-sample run helloworld.ts Compile file:///usr/src/app/helloworld.ts Download https://deno.land/std/fmt/colors.ts Warning Implicitly using master branch https://deno.land/std/fmt/colors.ts Hello world!
With tool like "Puppeteer", we can add a lot things with our Chrome Headless.
With some code in NodeJS, we can improve and make some tests.
See the with-puppeteer folder for more details. We have to follow the mapping of Chromium => Puppeteer described here.
If you have a NodeJS/Puppeteer script in your src folder named pdf.js, you can launch it using the following command:
docker container run -it --rm -v $(pwd)/src:/usr/src/app/src --cap-add=SYS_ADMIN zenika/alpine-chrome:with-puppeteer node src/pdf.js
With the "font-wqy-zenhei" library, you could also manipulate asian pages like in with-puppeteer/test/screenshot-asia.js
docker container run -it --rm -v $(pwd)/with-puppeteer/test:/usr/src/app/test --cap-add=SYS_ADMIN zenika/alpine-chrome:with-puppeteer node test/screenshot-asia.js
These websites are tested with the following supported languages:
https://m.baidu.com)https://www.yahoo.co.jp/)https://www.naver.com/)According to puppeteer official doc you can not test a Chrome Extension in headless mode. You need a display available, that's where Xvfb comes in.
See the with-puppeteer-xvfb folder for more details. We have to follow the mapping of Chromium => Puppeteer described here.
Assuming you have a NodeJS/Puppeteer script in your src folder named extension.js, and the unpacked extension in the src/chrome-extension folder, you can launch it using the following command:
docker container run -it --rm -v $(pwd)/src:/usr/src/app/src --cap-add=SYS_ADMIN zenika/alpine-chrome:with-puppeteer-xvfb node src/extension.js
The extension provided will change the page background in red for every website visited. This test test/test.js will load the extension and take a screenshot of the https://example.com website.
Like "Puppeteer", we can do a lot things using "Playwright" with our Chrome Headless.
Go to the with-playwright folder and launch the following command:
docker container run -it --rm -v $(pwd)/test:/usr/src/app/test --cap-add=SYS_ADMIN zenika/alpine-chrome:with-playwright node test/test.js
An example.png file will be created in the with-playwright/test folder.
By default, this image works with WebGL.
If you want to disable it, make sure to add --disable-gpu when launching Chromium.
docker container run -it --rm --cap-add=SYS_ADMIN -v $(pwd):/usr/src/app zenika/alpine-chrome --screenshot --hide-scrollbars https://webglfundamentals.org/webgl/webgl-fundamentals.html
docker container run -it --rm --cap-add=SYS_ADMIN -v $(pwd):/usr/src/app zenika/alpine-chrome --screenshot --hide-scrollbars https://browserleaks.com/webgl
ChromeDriver is a separate executable that Selenium WebDriver uses to control Chrome. You can use this image as a base for your Docker based selenium tests. See Guide for running Selenium tests using Chromedriver.
Selenoid is a powerful implementation of Selenium hub using Docker containers to launch browsers.
Even if it used to run browsers in docker containers, it can be quite useful as lightweight Selenium replacement.
with-selenoid image is a self sufficient selenium server, chrome and chromedriver installed.
You can run it with following command:
docker container run -it --rm --cap-add=SYS_ADMIN -p 4444:4444 zenika/alpine-chrome:with-selenoid -capture-driver-logs
And run your tests against http://localhost:4444/wd/hub
One of the use-cases might be running automation tests in the environment with restricted Docker environment
like on some CI systems like GitLab CI, etc. In such case you may not have permissions for --cap-add=SYS_ADMIN
and you will need to pass the --no-sandbox to chromedriver.
See more selenoid docs
We can run the container as root with this command:
docker container run --rm -it --entrypoint "" --user root zenika/alpine-chrome sh
Some examples are available on the examples directory:


免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具


最适合小白的AI自动化工作流平台
无需编码,轻松生成可复用、可变现的AI自动化工作流

大模型驱动的Excel数据处理工具
基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI论文写作指导平台
AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量提升解决方案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号