@@ -18,7 +18,7 @@ _✨ NoneBot2 命令行工具 Docker 插件 ✨_
1818 <a href =" https://pypi.python.org/pypi/nb-cli-plugin-docker " >
1919 <img src="https://img.shields.io/pypi/v/nb-cli-plugin-docker" alt="pypi">
2020 </a >
21- <img src =" https://img.shields.io/badge/python-3.8 +-blue " alt =" python " >
21+ <img src =" https://img.shields.io/badge/python-3.10 +-blue " alt =" python " >
2222 <a href =" https://results.pre-commit.ci/latest/github/nonebot/nb-cli-plugin-docker/master " >
2323 <img src="https://results.pre-commit.ci/badge/github/nonebot/cli-plugin-docker/master.svg" alt="pre-commit" />
2424 </a >
@@ -43,14 +43,37 @@ _✨ NoneBot2 命令行工具 Docker 插件 ✨_
4343
4444详细安装方法请参考 [ Docker 文档] ( https://docs.docker.com/engine/install/ )
4545
46- 官方 Linux 快速安装一键脚本:
46+ Docker 官方 Linux 快速安装一键脚本:
4747
4848``` bash
4949curl -fsSL https://get.docker.com | sudo sh
5050```
5151
5252## 安装插件
5353
54+ ### uv tool / uvx(推荐)
55+
56+ 首先需要[ 安装 uv] ( https://docs.astral.sh/uv/#installation ) 。
57+
58+ 直接使用:
59+
60+ ``` bash
61+ uvx --from nb-cli --with nb-cli-plugin-docker nb docker
62+ # 或
63+ uv tool run --from nb-cli --with nb-cli-plugin-docker nb docker
64+ ```
65+
66+ 安装:
67+
68+ ``` bash
69+ uv tool install --with nb-cli-plugin-docker nb-cli
70+
71+ # 更新环境变量(如果需要)
72+ uv tool update-shell
73+ ```
74+
75+ ### 通用方式
76+
5477``` bash
5578nb self install nb-cli-plugin-docker
5679```
@@ -63,3 +86,39 @@ nb docker
6386# nb deploy
6487# nb compose
6588```
89+
90+ ### generate
91+
92+ 生成 ` Dockerfile ` 和 ` docker-compose.yml ` 。
93+
94+ #### 什么时候需要(重新)生成?
95+
96+ - 在项目中首次使用本插件时;
97+ - 更换了机器人项目的管理器时。
98+
99+ #### 传递项目依赖
100+
101+ 对于使用了 ` uv ` , ` pdm ` 或 ` poetry ` 的机器人项目,本插件会自动检查相应的依赖固定信息(即 ` *.lock ` 文件)判断并调用相应工具自动向容器内传递依赖。
102+
103+ 对于其他管理方式的机器人项目,则需要手动导出一份 ` requirements.txt ` 来传递项目依赖到容器内,例如:
104+
105+ ``` bash
106+ source .venv/bin/activate
107+ pip freeze > requirements.txt
108+ ```
109+
110+ ### build
111+
112+ 构建机器人镜像。
113+
114+ ### up / down
115+
116+ 部署/取消部署机器人实例。
117+
118+ ### logs
119+
120+ 查看机器人日志。
121+
122+ ### ps
123+
124+ 查看机器人运行状态。
0 commit comments