准备
在使用本插件前请确保 Docker CLI 以及 Docker Compose Plugin 已经安装,且可以从命令行直接使用。
详细安装方法请参考 Docker 文档
Docker 官方 Linux 快速安装一键脚本:
curl -fsSL https://get.docker.com | sudo sh
安装插件
uv tool / uvx(推荐)
首先需要安装 uv。
直接使用:
uvx --from nb-cli --with nb-cli-plugin-docker nb docker
# 或
uv tool run --from nb-cli --with nb-cli-plugin-docker nb docker
安装:
uv tool install --with nb-cli-plugin-docker nb-cli
# 更新环境变量(如果需要)
uv tool update-shell
通用方式
nb self install nb-cli-plugin-docker
使用插件
nb docker
# 其他别名
# nb deploy
# nb compose
generate
生成 Dockerfile 和 docker-compose.yml。
什么时候需要(重新)生成?
- 在项目中首次使用本插件时;
- 更换了机器人项目的管理器时。
传递项目依赖
对于使用了 uv, pdm 或 poetry 的机器人项目,本插件会自动检查相应的依赖固定信息(即 *.lock 文件)判断并调用相应工具自动向容器内传递依赖。
对于其他管理方式的机器人项目,则需要手动导出一份 requirements.txt 来传递项目依赖到容器内,例如:
source .venv/bin/activate
pip freeze > requirements.txt
build
构建机器人镜像。
up / down
部署/取消部署机器人实例。
logs
查看机器人日志。
ps
查看机器人运行状态。
Metadata
Release files for nb-cli-plugin-docker 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nb_cli_plugin_docker-0.6.1.tar.gz | 14.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nb_cli_plugin_docker-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.9 kB
Release files / nb_cli_plugin_docker-0.6.1.tar.gz
| Download URL | nb_cli_plugin_docker-0.6.1.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
122799062ad65c42dfc1a1745bedfc047f248f92aee3457070f43e45bcf13db9
|
|
BLAKE2b-256 checksum How to use checksums |
cf8f6c836012a1d4fe85ceb16456ff6c0c1b8153f77566e79254e987ece68d90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 10, 2026.
Transparency logRelease files / nb_cli_plugin_docker-0.6.1-py3-none-any.whl
| Download URL | nb_cli_plugin_docker-0.6.1-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e3899456eed1cdf91784e33db7924dbc03ab1447029f5d2a7a24f5dbe662612
|
|
BLAKE2b-256 checksum How to use checksums |
8073f68ea3430c27839d0a419fbcd6c7927e6d6172778fb30ddcac53329e5960
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 10, 2026.
Transparency log