docker support for nb-cli
Project description
NB CLI Plugin Docker
✨ NoneBot2 命令行工具 Docker 插件 ✨
准备
在使用本插件前请确保 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
查看机器人运行状态。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nb_cli_plugin_docker-0.6.1.tar.gz.
File metadata
- Download URL: nb_cli_plugin_docker-0.6.1.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
122799062ad65c42dfc1a1745bedfc047f248f92aee3457070f43e45bcf13db9
|
|
| MD5 |
be423bfaa6fcc7dc9d6a3a9d695094ef
|
|
| BLAKE2b-256 |
cf8f6c836012a1d4fe85ceb16456ff6c0c1b8153f77566e79254e987ece68d90
|
Provenance
The following attestation bundles were made for nb_cli_plugin_docker-0.6.1.tar.gz:
Publisher:
release.yml on nonebot/cli-plugin-docker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nb_cli_plugin_docker-0.6.1.tar.gz -
Subject digest:
122799062ad65c42dfc1a1745bedfc047f248f92aee3457070f43e45bcf13db9 - Sigstore transparency entry: 938092178
- Sigstore integration time:
-
Permalink:
nonebot/cli-plugin-docker@73c47927fe0bf1f3fda919f201b1619977038917 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/nonebot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@73c47927fe0bf1f3fda919f201b1619977038917 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nb_cli_plugin_docker-0.6.1-py3-none-any.whl.
File metadata
- Download URL: nb_cli_plugin_docker-0.6.1-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e3899456eed1cdf91784e33db7924dbc03ab1447029f5d2a7a24f5dbe662612
|
|
| MD5 |
15f53b802435a84e6b77413f5eb663d4
|
|
| BLAKE2b-256 |
8073f68ea3430c27839d0a419fbcd6c7927e6d6172778fb30ddcac53329e5960
|
Provenance
The following attestation bundles were made for nb_cli_plugin_docker-0.6.1-py3-none-any.whl:
Publisher:
release.yml on nonebot/cli-plugin-docker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nb_cli_plugin_docker-0.6.1-py3-none-any.whl -
Subject digest:
5e3899456eed1cdf91784e33db7924dbc03ab1447029f5d2a7a24f5dbe662612 - Sigstore transparency entry: 938092195
- Sigstore integration time:
-
Permalink:
nonebot/cli-plugin-docker@73c47927fe0bf1f3fda919f201b1619977038917 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/nonebot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@73c47927fe0bf1f3fda919f201b1619977038917 -
Trigger Event:
push
-
Statement type: