
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Rendertron is a dockerized, headless Chrome rendering solution designed to render & serialise web pages on the fly.
Rendertron is designed to enable your Progressive Web App (PWA) to serve the correct content to any bot that doesn't render or execute Javascript. Rendertron runs as a standalone HTTP server. Rendertron renders requested pages using Headless Chrome, auto-detecting when your PWA has completed loading and serializes the response back to the original request. To use Rendertron, your application configures middleware to determine whether to proxy a request to Rendertron. Rendertron is compatible with all client side technologies, including web components.
Demo endpoint
A demo Rendertron service is available at [***] It is not designed to be used as a production endpoint. You can use it, but there are no uptime guarantees.
Once you have the service up and running, you'll need to implement the differential serving layer. This checks the user agent to determine whether prerendering is required.
This is a list of middleware available to use with the Rendertron service:
Rendertron is also compatible with prerender.io middleware. Note: the user agent lists differ there.
/render/<url>
The render endpoint will render your page and serialize your page. Available options:
wc-inject-shadydom default false - used to correctly render Web Components v1. See
Using with web components for more information./screenshot/<url>
The screenshot endpoint can be used to verify that your page is rendering correctly.
Available options:
width default 1000 - used to set the viewport width (max 2000)height default 1000 - used to set the viewport height (max 2000)When setting query parameters as part of your URL, ensure they are encoded correctly. In JS,
this would be encodeURIComponent(myURLWithParams). For example to specify page=home:
https://render-tron.appspot.com/render/http://my.domain/%3Fpage%3Dhome
The service detects when a page has loaded by looking at the page load event, ensuring there are no outstanding network requests and that the page has had ample time to render.
There is a hard limit of 10 seconds for rendering. Ensure you don't hit this budget by ensuring your application is rendered well before the budget expires.
In some cases, the auto loading function may be insufficient, for example if there is content being streamed on the page. To explicitly signal when the page is visually complete, fire an event as follows:
jsmyElement.dispatchEvent(new Event('render-complete', { bubbles: true, composed: true}));
Headless Chrome supports web components but shadow DOM is difficult to serialize effectively. As such, https://github.com/webcomponents/shadydom (a lightweight shim for Shadow DOM) is required for web components.
If you are using web components v0 (deprecated), you will need to enable Shady DOM to
render correctly. In Polymer 1.x, which uses web components v0, Shady DOM is enabled by default.
If you are using Shadow DOM, override this by setting the query parameter dom=shady when
directing requests to the Rendertron service.
If you are using web components v1 and either webcomponents-lite.js or webcomponents-loader.js,
set the query parameter wc-inject-shadydom=true when directing requests to the Rendertron
service. This renderer service will force the necessary polyfills to be loaded and enabled.
Status codes from the initial requested URL are preserved. If this is a 200, or 304, you can set the HTTP status returned by the rendering service by adding a meta tag.
html<meta name="render:status_code" content="404" />
This project requires Node 7+ and Docker (installation instructions). For deployment this project uses the Google Cloud Platform SDK.
Install node dependencies using:
bashnpm install
Install Chrome:
bashapt-get install google-chrome
With a local instance of Chrome installed, you can start the server locally:
bashnpm start
To test a rendering, send a request:
http://localhost:3000/?url=https://dynamic-meta.appspot.com
After installing docker, build the docker image:
bashdocker build -t rendertron . --no-cache=true
The container enables the cache to run by default, so be sure to disable the cache when running locally.
Building the container:
bashdocker run -it -p 8080:8080 --name rendertron-container rendertron
In the case where your kernel lacks user namespace support or are receiving a ECONNREFUSED error when trying to access the service in the container (as noted in issues https://github.com/GoogleChrome/rendertron/issues/2 and https://github.com/GoogleChrome/rendertron/issues/3), the two recommended methods below should solve this:
-security-opt flag--cap-add SYS_ADMIN flag[Recommended] Start a container with the built image using Jessie Frazelle' seccomp profile for Chrome:
bashwget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json docker run -it -p 8080:8080 --security-opt seccomp=$HOME/chrome.json --name rendertron-container rendertron
Start a container with the built image using SYS_ADMIN:
bashdocker run -it -p 8080:8080 --cap-add SYS_ADMIN --name rendertron-container rendertron
Load the homepage in any browser:
bashhttp://localhost:8080/
Stop the container:
bashdocker kill rendertron-container
Clear containers:
bashdocker rm -f $(docker ps -a -q)
gcloud app deploy app.yaml --project <your-project-id>
When deploying the service, set configuration variables by including a config.json in the
root. Available configuration options:
analyticsTrackingId default "" - set to a Google Analytics property
tracking id to
send Rendertron rendering events to analytics.cache default false - set to true to enable caching on Google Cloud using datastoredebug default false - set to true to log console messages from within the
rendered pages.renderOnly - restrict the endpoint to only service requests for certain domains. Specified
as an array of strings. eg. ['http://render.only.this.domain']. This is a strict prefix
match, so ensure you specify the exact protocols that will be used (eg. http, https).您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。




来自真实用户的反馈,见证轩辕镜像的优质服务