Docker
容器化部署 OpenClaw
· ☕ 2 分钟
1. 启动容器 设置镜像 1 export IMAGE=ghcr.io/openclaw/openclaw:2026.3.2 生成随机 token 1 openssl rand -hex 32 设置网关 token 1 export OPENCLAW_GATEWAY_TOKEN=xxx 这个 token 会用于远程 Web 端,本地 Tui 端的认证。 设置目录权限 1 2 mkdir -p openclaw-home chmod -R 777 openclaw-home 启动容器 1 2 3 4 5 6 7 nerdctl run -d --user root \ --name openclaw \ --restart always \ -p 18789:18789 \ -v $(pwd)/openclaw-home:/root/ \ $IMAGE \ sleep infinity 删除容器 1 nerdctl rm openclaw --force 2. 启动服务 创建配置文件 1 2 3

容器化部署 DeepSeek 3FS 存储系统
· ☕ 7 分钟
1. 部署方案 在开始容器化部署之前,先提几点要求: 为了简化交付,只需要一个镜像 为了可靠性,尽可能多副本部署 通过不同的参数启动不同的服务 通过环境变量注入配置,渲染到配置文件中 下面是 DeepSeek 3FS 的部署方案: 需要部署: 一个 Monitor 用来收集监控数据,数据存储在 ClickHouse 中 一

常用 AI 基础镜像及启动命令
· ☕ 2 分钟
1. 镜像 Tag 标识的含义 base/cuda: 包括 CUDA 运行时 runtime: 在 base 的基础上,新增了 CUDA math 库和 NCCL、cuDNN 运行时 devel: 在 runtime 的基础上,新增了头文件和用于构建 CUDA 镜像的开发工具,对于多阶段构建特别有用 cuddn: 在上面基础上,新增了 cuDNN 神经网络加速库 py3: Python 3 环境 2. CUDA 镜像 镜像 AMD64 镜像大小 ARM64 镜

Nydus 懒加载镜像配置与实践
· ☕ 5 分钟
据统计容器中的大部分文件不会被使用。根据这一特征,Nydus 自定义了 Rafs 格式的文件系统,实现了镜像文件的按需加载,以解决大镜像导致的启动慢和占用存储的问题。而在 AI 场景下,无论是推理还是训练,镜像常常都是几个 G 起步,甚至几十个 G,Nydus 非常

容器下的 Go 应用程序优化
· ☕ 2 分钟
1. 内存对齐 结构体内字段,从大到小排列 减少内存占用 安装 fieldalignment 工具 1 go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest 分析并修复内存对齐 1 2 3 4 5 6 7 8 9 fieldalignment -fix ./... /Users/shaowenchen/Code/app/config/config.go:136:14: struct with 32 pointer bytes could be 24 /Users/shaowenchen/Code/app/config/config.go:150:11: struct of size 96 could be 88 /Users/shaowenchen/Code/app/config/config.go:166:14: struct of size 152 could be 144 /Users/shaowenchen/Code/app/config/config.go:194:12: struct with 80 pointer bytes could be 72 /Users/shaowenchen/Code/app/config/config.go:209:12: struct with 56 pointer bytes could be 40 /Users/shaowenchen/Code/app/dao/gormx/gorm.go:12:13: struct with 16 pointer bytes could be 8 /Users/shaowenchen/Code/app/dao/gormx/entity/cluster.go:5:14: struct with 128 pointer bytes could be 104 查看 fieldalignment 进行