Skip to content

Commit 3e0090c

Browse files
webssh-devcodebuff-team
andcommitted
docs: 明确镜像升级必须重建容器,restart 不会换镜像
面板/命令行的「重启」只是重启现有容器,它始终绑在创建时那个镜像 ID 上,新拉取的 镜像不会生效——这次飞牛上就是卡在这一步。把「拉取 → 重建」的完整命令、compose 的 原地更新方式,以及 docker inspect -f '{{.Image}}' 自检办法写进 README 与 DOCKERHUB.md(CI 会把 DOCKERHUB.md 同步成 Hub 仓库描述)。 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 51d41f5 commit 3e0090c

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎DOCKERHUB.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,34 @@ docker compose up -d
8686

8787
---
8888

89+
## 更新到新版本
90+
91+
镜像**不会自己升级**,`docker restart` 或面板里的「重启」只是重启**现有容器**——
92+
它依然绑在创建时那个镜像 ID 上,后拉取的新镜像不会自动生效。所以升级必须
93+
**先拉取、再重建容器**:
94+
95+
```bash
96+
docker pull nameguoguo/webssh:latest
97+
docker rm -f webssh
98+
docker run -d --name webssh -p 9627:9627 --restart=unless-stopped \
99+
-e AUTH_TOKEN=你的密码 -v ./data:/app/core/server/data nameguoguo/webssh:latest
100+
```
101+
102+
用 compose 部署的原地更新即可:
103+
104+
```bash
105+
docker compose pull && docker compose up -d
106+
```
107+
108+
确认升级生效:
109+
110+
```bash
111+
docker inspect -f '{{.Image}}' webssh # 这个 ID 每次升级都应该变化
112+
docker logs --tail 50 webssh # 应看到 “WebSSH ready”
113+
```
114+
115+
---
116+
89117
## 常用环境变量
90118

91119
| 变量 | 默认值 | 说明 |

‎README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ services:
9090

9191
4. 浏览器访问 `http://localhost:9627`。
9292

93+
5. 升级到新版本(**必须重建容器**,`docker restart` 不会换镜像):
94+
95+
```bash
96+
docker pull nameguoguo/webssh:latest
97+
docker rm -f webssh
98+
docker run -d --name webssh -p 9627:9627 --restart=unless-stopped \
99+
-e AUTH_TOKEN=你的密码 nameguoguo/webssh:latest
100+
```
101+
102+
> ⚠️ 容器绑在创建时的镜像 ID 上,只拉取不重建等于没升级(`docker inspect -f '{{.Image}}' webssh`
103+
> 的 ID 不变就说明还是旧镜像)。用 compose 部署的直接 `docker compose pull && docker compose up -d`。
104+
93105
> 🖥️ **启用 RDP / VNC 远程桌面**:使用上面带 `guacd` 服务的 compose 配置
94106
> (`GUACD_HOST` 指向 guacd 容器),启动后在新建连接时选择 RDP 或 VNC 协议,
95107
> 画面直接在网页里显示(键盘 / 鼠标 / 触屏可用)。Cloudflare 部署无 guacd,

0 commit comments

Comments
 (0)