
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Simple image to deploy https://github.com/xwmx/nb in docker environment.
dockerdocker composedockerdocker composenb environment variablesnb-docker environment variablesThis docker image allows you to run https://github.com/xwmx/nb server in docker environment. To allow better update, to features was added.
You can configure your git server to execute a webhook to allow nb-docker to
update nb notebooks. To enable it, set the NBDOCKER_WEBHOOK_PASSWORD
environment variable with the password required for your webhook. This password
will have to be given on the X-Authentication header, as is.
Here is an example of curl command to call the webhook. For this example to
work, the NBDOCKER_WEBHOOK_PASSWORD must be set to my-secret-password.
Please use a different password for production environment.
bashcurl -d '{}' -H "x-authentication: my-secret-password" localhost:3000/webhook
:warning: The
NBDOCKER_WEBHOOK_PASSWORDonly protects the/webhookpath for the webhook server. It will not protect anybody accessing your notebooks. Protecting your notebooks must be done by a reverse proxy.
More info in configuration section.
If you can't use the webhook to sync your notebooks, you can enable the
periodic sync server by setting the variable
NBDOCKER_PERIODIC_SYNC_INTERVAL_MIN to the number of minutes you want the
sync to occur.
If the variable is not set or set to 0, the feature is disabled.
More info in configuration section.
This image doesn't try to restrict access to your nb notebooks. This must be
done by a reverse proxy. Setting up a reverse proxy is (yet ?) out of scope of
this documentation.
If you set up a reverse proxy with access restriction and you are using the
webhook server, you need to allow POST requests on /webhook path. The
webhook configuration will handle authentication on its own.
dockerbash# If required and wanted, enable buildkit export DOCKER_BUILDKIT=1 docker build -t lemarsu/nb .
docker composeUsing ./docker-compose.yaml inside the repository.
bashdocker compose build
When running, nb-docker expect to find notebooks in /nb/nb folder.
:warning: The folder must at least contain one notebook with at least one note, otherwise
nbwill exit automatically.
dockerbashdocker run -v ~/.nb:/nb/nb --rm -p 0.0.0.0:6789:6789/tcp -e NB_SERVER_BIND_HOST=0.0.0.0 -it lemarsu/nb:latest b --daemon
docker composeUsing ./docker-compose.yaml inside the repository.
bashdocker compose up --build
--buildis not needed if the image has been build in the previous chapter.
All nb-docker configuration is done by setting environment variables
nb environment variablesAll nb configuration variables are followed as is. But if they are not
defined, then some defaults are overridden as presented in the following table.
| Name | Overridden default | Reason |
|---|---|---|
NB_BROWSER | echo | browse doesn't start the server if nb can't find the expected browser. |
NB_EDITOR | echo | nb won't start if he can't find the NB_EDITOR editor. |
NB_DIR | /nb/nb | nb will search for notebooks in this folder. Only change this if you know what your are doing. |
NB_PATH | /nb/nbrc | nb will read this file for configuration. The file is not created by default. |
nb-docker environment variablesThe following variables allow to configure nb-docker behaviour.
| Name | Required | Default | Description |
|---|---|---|---|
NBDOCKER_GIT_USER_EMAIL | false | nb | User name used by git for commits. |
NBDOCKER_GIT_USER_NAME | false | not@val.id | User email used by git for commits. |
NBDOCKER_GIT_CREDENTIALS_PASSWORD | false* | N/A | User used for git credentials. |
NBDOCKER_GIT_CREDENTIALS_USERNAME | false* | N/A | Password used for git credentials. |
NBDOCKER_PERIODIC_SYNC_INTERVAL_MIN | false | N/A | Enable periodic sync. |
NBDOCKER_WEBHOOK_PASSWORD | false | N/A | Enable webhook server and use the value as password. |
NBDOCKER_WEBHOOK_HOST | false | 0.0.0.0 | If enabled, Webhook server will listen on this host. |
NBDOCKER_WEBHOOK_PORT | false | 3000 | If enabled, Webhook server will listen on this port. |
* These variables are required if any of this condition is true :
NB_AUTO_SYNCis unset or set to1NBDOCKER_PERIODIC_SYNC_INTERVAL_MINis set to something other than0.
If
NBDOCKER_GIT_CREDENTIALS_USERNAMEandNBDOCKER_GIT_CREDENTIALS_PASSWORDare set, git will be configured to use those credentials.
This debian based container allows the following built-in configuration variables.
| Name | Required | Default | Description |
|---|---|---|---|
TZ | false | UTC | Defined container timezone. Useful for dates in logs. |
LANG | false | C.utf8 | The default is changed from C. When the value is C, utf8 text get mangled. |
nb-docker.您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务