|
1 | | -# dev-docker 配置示例 |
| 1 | +# dev-docker 配置示例 / Configuration Examples |
2 | 2 |
|
3 | | -## 快速开始示例 |
| 3 | +## 快速开始示例 / Quick Start Examples |
4 | 4 |
|
5 | | -### 1. 默认配置(推荐) |
| 5 | +### 1. 默认配置(推荐) / Default Configuration (Recommended) |
6 | 6 | ```bash |
7 | | -# Ubuntu 22.04 + 完整模式 |
| 7 | +# Ubuntu 22.04 + 完整模式 / Ubuntu 22.04 + Full mode |
8 | 8 | ./setup.sh |
9 | 9 | ``` |
10 | 10 |
|
11 | | -### 2. 不同操作系统版本 |
| 11 | +### 2. 不同操作系统版本 / Different OS Versions |
12 | 12 |
|
13 | | -#### Ubuntu 20.04(精简模式) |
| 13 | +#### Ubuntu 20.04(精简模式) / Ubuntu 20.04 (Minimal) |
14 | 14 | ```bash |
15 | 15 | ./setup.sh -o ubuntu2004 -m minimal -b |
16 | 16 | ``` |
17 | 17 |
|
18 | | -#### Ubuntu 24.04(完整模式) |
| 18 | +#### Ubuntu 24.04(完整模式) / Ubuntu 24.04 (Full) |
19 | 19 | ```bash |
20 | 20 | ./setup.sh -o ubuntu2404 -m full -b |
21 | 21 | ``` |
22 | 22 |
|
23 | | -#### CentOS 7(完整模式) |
| 23 | +#### CentOS 7(完整模式) / CentOS 7 (Full) |
24 | 24 | ```bash |
25 | 25 | ./setup.sh -o centos7 -m full -b |
26 | 26 | ``` |
27 | 27 |
|
28 | | -#### CentOS Stream 8(精简模式) |
| 28 | +#### CentOS Stream 8(精简模式) / CentOS Stream 8 (Minimal) |
29 | 29 | ```bash |
30 | 30 | ./setup.sh -o centos8 -m minimal -b |
31 | 31 | ``` |
32 | 32 |
|
33 | | -### 3. 构建模式对比 |
| 33 | +### 3. 构建模式对比 / Build Mode Comparison |
34 | 34 |
|
35 | | -#### 完整模式(full)- 适合完整开发 |
| 35 | +#### 完整模式(full)- 适合完整开发 / Full Mode - For Complete Development |
36 | 36 | ```bash |
37 | 37 | ./setup.sh -m full -b |
38 | 38 | ``` |
39 | | -- 包含 LLVM/Clang 18 |
| 39 | +- 包含 LLVM/Clang 18 / Includes LLVM/Clang 18 |
40 | 40 | - ZSH + Oh My Zsh |
41 | 41 | - Miniconda |
42 | | -- 所有开发工具 |
43 | | -- 镜像大小:~2-3GB |
44 | | -- 构建时间:~10-15分钟 |
| 42 | +- 所有开发工具 / All development tools |
| 43 | +- 镜像大小:~2-3GB / Image size: ~2-3GB |
| 44 | +- 构建时间:~10-15分钟 / Build time: ~10-15 minutes |
45 | 45 |
|
46 | | -#### 精简模式(minimal)- 适合快速开发/CI |
| 46 | +#### 精简模式(minimal)- 适合快速开发/CI / Minimal Mode - For Quick Development/CI |
47 | 47 | ```bash |
48 | 48 | ./setup.sh -m minimal -b |
49 | 49 | ``` |
50 | | -- 基础开发工具(gcc、git、cmake) |
| 50 | +- 基础开发工具(gcc、git、cmake) / Basic dev tools (gcc, git, cmake) |
51 | 51 | - Bash shell |
52 | | -- 无 LLVM/Clang |
53 | | -- 无 Miniconda |
54 | | -- 镜像大小:~800MB-1GB |
55 | | -- 构建时间:~5-8分钟 |
| 52 | +- 无 LLVM/Clang / No LLVM/Clang |
| 53 | +- 无 Miniconda / No Miniconda |
| 54 | +- 镜像大小:~800MB-1GB / Image size: ~800MB-1GB |
| 55 | +- 构建时间:~5-8分钟 / Build time: ~5-8 minutes |
56 | 56 |
|
57 | | -### 4. 常用操作 |
| 57 | +### 4. 常用操作 / Common Operations |
58 | 58 |
|
59 | 59 | ```bash |
60 | | -# 列出可用的 OS 版本 |
| 60 | +# 列出可用的 OS 版本 / List available OS versions |
61 | 61 | ./setup.sh -l |
62 | 62 |
|
63 | | -# 查看当前配置 |
| 63 | +# 查看当前配置 / View current configuration |
64 | 64 | ./setup.sh -c |
65 | 65 |
|
66 | | -# 仅运行容器(不重新构建) |
| 66 | +# 仅运行容器(不重新构建) / Run container only (without rebuilding) |
67 | 67 | ./setup.sh -r |
68 | 68 |
|
69 | | -# 查询容器 IP |
| 69 | +# 查询容器 IP / Query container IP |
70 | 70 | ./setup.sh -i |
71 | 71 |
|
72 | | -# 停止并删除容器 |
| 72 | +# 停止并删除容器 / Stop and remove container |
73 | 73 | ./setup.sh -s |
74 | 74 | ``` |
75 | 75 |
|
76 | | -### 5. 代理配置 |
| 76 | +### 5. 代理配置 / Proxy Configuration |
77 | 77 |
|
78 | 78 | ```bash |
79 | | -# 构建时使用代理 |
| 79 | +# 构建时使用代理 / Use proxy during build |
80 | 80 | export HTTP_PROXY="http://proxy.example.com:8080" |
81 | 81 | export HTTPS_PROXY="http://proxy.example.com:8080" |
82 | 82 | ./setup.sh -b |
83 | 83 |
|
84 | | -# 或者在容器内配置代理 |
| 84 | +# 或者在容器内配置代理 / Or configure proxy inside container |
85 | 85 | docker exec -it dev_ubuntu2204_full_sheen bash |
86 | 86 | cd ~/scripts |
87 | 87 | ./set_proxy.sh -s http://proxy.example.com:8080 |
88 | 88 | ``` |
89 | 89 |
|
90 | | -### 6. 多容器管理 |
| 90 | +### 6. 多容器管理 / Multi-Container Management |
91 | 91 |
|
92 | | -你可以同时运行不同配置的容器: |
| 92 | +你可以同时运行不同配置的容器: / You can run containers with different configurations simultaneously: |
93 | 93 |
|
94 | 94 | ```bash |
95 | | -# 构建 Ubuntu 22.04 完整模式 |
| 95 | +# 构建 Ubuntu 22.04 完整模式 / Build Ubuntu 22.04 full mode |
96 | 96 | ./setup.sh -o ubuntu2204 -m full -b |
97 | | -# 容器名: dev_ubuntu2204_full_sheen |
| 97 | +# 容器名 / Container name: dev_ubuntu2204_full_sheen |
98 | 98 |
|
99 | | -# 构建 Ubuntu 22.04 精简模式 |
| 99 | +# 构建 Ubuntu 22.04 精简模式 / Build Ubuntu 22.04 minimal mode |
100 | 100 | ./setup.sh -o ubuntu2204 -m minimal -b |
101 | | -# 容器名: dev_ubuntu2204_minimal_sheen |
| 101 | +# 容器名 / Container name: dev_ubuntu2204_minimal_sheen |
102 | 102 |
|
103 | | -# 构建 CentOS 8 完整模式 |
| 103 | +# 构建 CentOS 8 完整模式 / Build CentOS 8 full mode |
104 | 104 | ./setup.sh -o centos8 -m full -b |
105 | | -# 容器名: dev_centos8_full_sheen |
| 105 | +# 容器名 / Container name: dev_centos8_full_sheen |
106 | 106 | ``` |
107 | 107 |
|
108 | | -每个配置会创建独立的镜像和容器,互不冲突。 |
| 108 | +每个配置会创建独立的镜像和容器,互不冲突。 / Each configuration creates independent images and containers without conflicts. |
109 | 109 |
|
110 | | -### 7. 工作区目录结构 |
| 110 | +### 7. 工作区目录结构 / Workspace Directory Structure |
111 | 111 |
|
112 | 112 | ``` |
113 | 113 | ~/workspace/ |
114 | | -├── dev_ubuntu2204_full_sheen/ # Ubuntu 22.04 完整模式工作区 |
115 | | -├── dev_ubuntu2204_minimal_sheen/ # Ubuntu 22.04 精简模式工作区 |
116 | | -├── dev_ubuntu2404_full_sheen/ # Ubuntu 24.04 完整模式工作区 |
117 | | -└── dev_centos8_full_sheen/ # CentOS 8 完整模式工作区 |
| 114 | +├── dev_ubuntu2204_full_sheen/ # Ubuntu 22.04 完整模式工作区 / Full mode workspace |
| 115 | +├── dev_ubuntu2204_minimal_sheen/ # Ubuntu 22.04 精简模式工作区 / Minimal mode workspace |
| 116 | +├── dev_ubuntu2404_full_sheen/ # Ubuntu 24.04 完整模式工作区 / Full mode workspace |
| 117 | +└── dev_centos8_full_sheen/ # CentOS 8 完整模式工作区 / Full mode workspace |
118 | 118 | ``` |
119 | 119 |
|
120 | | -### 8. 实际应用场景 |
| 120 | +### 8. 实际应用场景 / Real-World Use Cases |
121 | 121 |
|
122 | | -#### 场景 1:C++ 开发(推荐完整模式) |
| 122 | +#### 场景 1:C++ 开发(推荐完整模式) / Scenario 1: C++ Development (Full Mode Recommended) |
123 | 123 | ```bash |
124 | 124 | ./setup.sh -o ubuntu2204 -m full -b |
125 | | -# 使用 LLVM/Clang 进行现代 C++ 开发 |
| 125 | +# 使用 LLVM/Clang 进行现代 C++ 开发 / Use LLVM/Clang for modern C++ development |
126 | 126 | ``` |
127 | 127 |
|
128 | | -#### 场景 2:Python 数据科学(推荐完整模式) |
| 128 | +#### 场景 2:Python 数据科学(推荐完整模式) / Scenario 2: Python Data Science (Full Mode Recommended) |
129 | 129 | ```bash |
130 | 130 | ./setup.sh -o ubuntu2404 -m full -b |
131 | | -# 使用 Miniconda 管理 Python 环境 |
| 131 | +# 使用 Miniconda 管理 Python 环境 / Use Miniconda to manage Python environments |
132 | 132 | ``` |
133 | 133 |
|
134 | | -#### 场景 3:CI/CD 流水线(推荐精简模式) |
| 134 | +#### 场景 3:CI/CD 流水线(推荐精简模式) / Scenario 3: CI/CD Pipeline (Minimal Mode Recommended) |
135 | 135 | ```bash |
136 | 136 | ./setup.sh -o ubuntu2204 -m minimal -b |
137 | | -# 快速构建,体积小,适合 CI/CD |
| 137 | +# 快速构建,体积小,适合 CI/CD / Fast build, small size, suitable for CI/CD |
138 | 138 | ``` |
139 | 139 |
|
140 | | -#### 场景 4:传统企业环境(CentOS) |
| 140 | +#### 场景 4:传统企业环境(CentOS) / Scenario 4: Traditional Enterprise Environment (CentOS) |
141 | 141 | ```bash |
142 | 142 | ./setup.sh -o centos7 -m full -b |
143 | | -# 兼容企业级 CentOS 环境 |
| 143 | +# 兼容企业级 CentOS 环境 / Compatible with enterprise CentOS environments |
144 | 144 | ``` |
145 | 145 |
|
146 | | -### 9. SSH 连接 |
| 146 | +### 9. SSH 连接 / SSH Connection |
147 | 147 |
|
148 | 148 | ```bash |
149 | | -# 获取容器 IP |
| 149 | +# 获取容器 IP / Get container IP |
150 | 150 | ./setup.sh -i |
151 | 151 |
|
152 | | -# SSH 连接(输出会显示具体命令) |
| 152 | +# SSH 连接(输出会显示具体命令) / SSH connection (output will show the exact command) |
153 | 153 | ssh sheen@<container_ip> |
154 | | -# 默认密码:123456 |
| 154 | +# 默认密码 / Default password:123456 |
155 | 155 | ``` |
156 | 156 |
|
157 | | -### 10. 自定义配置 |
| 157 | +### 10. 自定义配置 / Customization |
158 | 158 |
|
159 | | -编辑 `setup.sh` 顶部的变量: |
| 159 | +编辑 `setup.sh` 顶部的变量: / Edit variables at the top of `setup.sh`: |
160 | 160 |
|
161 | 161 | ```bash |
162 | | -# 修改容器用户名 |
| 162 | +# 修改容器用户名 / Change container username |
163 | 163 | container_user_name="your_username" |
164 | 164 |
|
165 | | -# 修改密码 |
| 165 | +# 修改密码 / Change password |
166 | 166 | container_passwd="your_secure_password" |
167 | 167 |
|
168 | | -# 修改工作区目录 |
| 168 | +# 修改工作区目录 / Change workspace directory |
169 | 169 | workspace_dir="/path/to/your/workspace" |
170 | 170 | ``` |
171 | 171 |
|
172 | | -## 支持的操作系统版本详情 |
| 172 | +## 支持的操作系统版本详情 / Supported OS Version Details |
173 | 173 |
|
174 | | -| OS 版本 | 支持的构建模式 | 特殊说明 | |
| 174 | +| OS 版本 / OS Version | 支持的构建模式 / Supported Build Modes | 特殊说明 / Notes | |
175 | 175 | |---------|---------------|---------| |
176 | | -| ubuntu2004 | minimal, full | LTS 长期支持 | |
177 | | -| ubuntu2204 | minimal, full | 默认版本,LTS | |
178 | | -| ubuntu2404 | minimal, full | 最新 LTS | |
179 | | -| centos7 | minimal, full | 企业级稳定版 | |
| 176 | +| ubuntu2004 | minimal, full | LTS 长期支持 / LTS long-term support | |
| 177 | +| ubuntu2204 | minimal, full | 默认版本,LTS / Default version, LTS | |
| 178 | +| ubuntu2404 | minimal, full | 最新 LTS / Latest LTS | |
| 179 | +| centos7 | minimal, full | 企业级稳定版 / Enterprise stable version | |
180 | 180 | | centos8 | minimal, full | CentOS Stream | |
181 | 181 |
|
182 | | -## 注意事项 |
| 182 | +## 注意事项 / Important Notes |
183 | 183 |
|
184 | | -1. **精简模式限制**: |
185 | | - - 不支持 LLVM/Clang |
186 | | - - 不支持 ZSH(使用 Bash) |
187 | | - - 不包含 Miniconda |
| 184 | +1. **精简模式限制 / Minimal Mode Limitations**: |
| 185 | + - 不支持 LLVM/Clang / No LLVM/Clang support |
| 186 | + - 不支持 ZSH(使用 Bash) / No ZSH support (uses Bash) |
| 187 | + - 不包含 Miniconda / Does not include Miniconda |
188 | 188 |
|
189 | | -2. **CentOS 特殊说明**: |
190 | | - - CentOS 7 使用 CentOS 官方源 |
191 | | - - CentOS 8 使用 CentOS Stream 8 |
192 | | - - 某些包名可能与 Ubuntu 不同 |
| 189 | +2. **CentOS 特殊说明 / CentOS Special Notes**: |
| 190 | + - CentOS 7 使用 CentOS 官方源 / CentOS 7 uses CentOS official sources |
| 191 | + - CentOS 8 使用 CentOS Stream 8 / CentOS 8 uses CentOS Stream 8 |
| 192 | + - 某些包名可能与 Ubuntu 不同 / Some package names may differ from Ubuntu |
193 | 193 |
|
194 | | -3. **镜像和容器命名**: |
195 | | - - 镜像名:`dev_<os_version>_<mode>_<host_user>` |
196 | | - - 容器名:`dev_<os_version>_<mode>_<container_user>` |
| 194 | +3. **镜像和容器命名 / Image and Container Naming**: |
| 195 | + - 镜像名 / Image name:`dev_<os_version>_<mode>_<host_user>` |
| 196 | + - 容器名 / Container name:`dev_<os_version>_<mode>_<container_user>` |
197 | 197 |
|
198 | | -4. **多版本共存**: |
199 | | - - 不同配置的容器可以同时运行 |
200 | | - - 每个容器有独立的工作区目录 |
201 | | - - 注意不要混淆不同容器的配置 |
| 198 | +4. **多版本共存 / Multi-Version Coexistence**: |
| 199 | + - 不同配置的容器可以同时运行 / Containers with different configurations can run simultaneously |
| 200 | + - 每个容器有独立的工作区目录 / Each container has its own workspace directory |
| 201 | + - 注意不要混淆不同容器的配置 / Be careful not to confuse configurations of different containers |
0 commit comments