Files
common-server-public/.workbuddy/memory/MEMORY.md
12600k-rog-d4 99afdbd82e 更新 Docker 镜像配置,清理 archive 文件
- 删除 archive/bbs-go 等历史代码
- 新增 nginx、frpc-client Docker 镜像配置
- 添加 .gitignore 忽略大文件
2026-04-03 00:22:53 +08:00

56 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MEMORY.md
## 服务器信息
### node1
- **IP**: 10.0.3.5
- **用户名**: awei
- **SSH 互信**: 已配置
## Docker 镜像构建流程
### 关键步骤
1. **清理服务端目录**(避免文件残留导致问题)
```bash
ssh awei@10.0.3.5 "rm -rf /tmp/<目录名> && mkdir -p /tmp/<目录名>"
```
2. **上传源码文件**
```bash
scp <本地文件> awei@10.0.3.5:/tmp/<目录名>/
```
3. **构建镜像**(带版本号)
```bash
ssh awei@10.0.3.5 "cd /tmp/<目录名> && docker build -t stonelan/<镜像名>:YYYYMMDD -t stonelan/<镜像名>:latest ."
```
4. **导出镜像**
```bash
ssh awei@10.0.3.5 "docker save -o /tmp/<镜像名>-YYYYMMDD.tar stonelan/<镜像名>:YYYYMMDD"
```
5. **下载到本地**
```bash
scp awei@10.0.3.5:/tmp/<镜像名>-YYYYMMDD.tar <本地路径>/
```
### 现有镜像
| 镜像名称 | 版本号 | 基础镜像 | 说明 |
|---------|--------|---------|------|
| stonelan/nginx | 1.0.1 | nginx:alpine | 反向代理,含自定义配置 |
| stonelan/frpc | 1.0.1 | alpine:3.19 | FRP 客户端 v0.61.1 |
### 注意事项
- **版本号格式**:语义化版本 `X.Y.Z`(如 1.0.0、1.0.1、1.1.0
- **每次构建必须递增版本号**,避免重复
- 构建前先清理服务端临时目录,避免旧文件干扰
- 本地 tar.gz 等二进制文件通过 scp 传输正常,无需特殊处理
### 已知问题
- **scp 传输速度慢**Windows OpenSSH 客户端传输速度约 0.76 MB/s12MB 文件需 2-3 分钟),暂无解决方案