-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy path15-docker-cicd.html
More file actions
438 lines (408 loc) · 24.3 KB
/
Copy path15-docker-cicd.html
File metadata and controls
438 lines (408 loc) · 24.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<script>
(function(){
try{
var t = localStorage.getItem('ros2-book-theme');
if(!t){ t = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; }
document.documentElement.setAttribute('data-theme', t);
}catch(e){}
})();
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chapter Fifteen — Docker and CI/CD: From "My Laptop" to Reliable Delivery</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.6.1/mermaid.min.js"></script>
<style>
:root{
--bg:#f6f4ef; --panel:#fffefb; --panel2:#f1efe8; --border:#e6e1d6;
--text:#211f1a; --muted:#7a7568; --accent:#3d4bf5; --accent-ink:#2732b8;
--accent2:#0e9e6e; --gold:#c8862c; --danger:#d64a3c; --purple:#8b5cf6; --radius:14px;
}
*{box-sizing:border-box;} html,body{margin:0;padding:0;}
body{background:var(--bg); color:var(--text); font-family:'Inter', -apple-system, sans-serif; line-height:1.85; font-size:17.5px; -webkit-font-smoothing:antialiased;}
.wrap{max-width:880px; margin:0 auto; padding:48px 24px 120px;}
.cover{border-radius:28px; background:#12142b; padding:64px 44px; margin-bottom:56px; position:relative; overflow:hidden; isolation:isolate;}
.cover::before{content:""; position:absolute; inset:-40%; background:
radial-gradient(38% 45% at 15% 20%, rgba(61,75,245,0.55), transparent 70%),
radial-gradient(35% 40% at 85% 15%, rgba(139,92,246,0.45), transparent 70%),
radial-gradient(45% 50% at 60% 90%, rgba(14,158,110,0.35), transparent 70%);
filter:blur(60px); z-index:0;}
.cover::after{content:""; position:absolute; inset:0; background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px); background-size: 20px 20px; z-index:0;}
.cover > *{position:relative; z-index:1;}
.kicker{display:inline-block; color:#c9cdff; font-weight:600; letter-spacing:.4px; font-size:13px; margin-bottom:18px; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.14); padding:6px 14px; border-radius:999px;}
.cover h1{font-size:2.6em; margin:0 0 12px; font-weight:800; line-height:1.3; color:#ffffff; letter-spacing:-.5px;}
.cover .subtitle{color:#aeb2d6; font-size:1.2em; margin-bottom:30px; font-weight:400;}
.meta-row{display:flex; flex-wrap:wrap; gap:10px; margin-top:18px;}
.chip{background:rgba(255,255,255,0.07); border:1px solid rgba(255,255,255,0.14); color:#d4d7f0; padding:7px 15px; border-radius:999px; font-size:.83em;}
h2{font-size:1.9em; font-weight:800; margin:72px 0 22px; display:flex; align-items:center; gap:14px; letter-spacing:-.3px;}
h2 .num{display:inline-flex; align-items:center; justify-content:center; min-width:40px; height:40px; padding:0 12px; border-radius:12px; background:var(--accent); box-shadow:0 6px 16px -4px rgba(61,75,245,0.5); color:#ffffff; font-size:.62em; font-weight:800; flex-shrink:0; white-space:nowrap;}
h3{font-size:1.3em; font-weight:700; margin:36px 0 14px; color:var(--accent-ink); letter-spacing:-.2px;}
h4{font-size:1.08em; font-weight:700; margin:24px 0 10px; color:var(--purple);}
p{margin:0 0 16px; color:#3c382f;} strong{color:var(--text); font-weight:700;} a{color:var(--accent);}
.box{border-radius:16px; padding:20px 24px; margin:22px 0; border:1px solid var(--border); background:var(--panel); position:relative; box-shadow:0 1px 2px rgba(33,31,26,0.03);}
.box-title{font-weight:800; margin-bottom:9px; display:flex; align-items:center; gap:8px; font-size:.96em; letter-spacing:.1px;}
.box p:last-child{margin-bottom:0;}
.box.idea{background:#eef0ff;border-color:#d6dafc;} .box.idea .box-title{color:var(--accent-ink);}
.box.mistake{background:#fdeeec; border-color:#f6d2cd;} .box.mistake .box-title{color:var(--danger);}
.box.eng{background:#f4effe; border-color:#e2d6fb;} .box.eng .box-title{color:var(--purple);}
.box.real{background:#eafaf3; border-color:#c9eeda;} .box.real .box-title{color:var(--accent2);}
.box.def{background:#fdf3e4; border-color:#f2ddb3;} .box.def .box-title{color:var(--gold);}
code, pre{font-family:'JetBrains Mono', monospace; direction:ltr; text-align:left;}
code{background:#eceaf9; border:1px solid #dcdaf3; border-radius:6px; padding:2px 7px; font-size:.87em; color:var(--accent-ink); display:inline-block;}
pre{background:#181a2e; border-radius:16px; padding:18px 20px; overflow-x:auto; margin:18px 0; font-size:.88em; line-height:1.65; box-shadow:0 12px 28px -16px rgba(24,26,46,0.5);}
pre code{background:none; border:none; padding:0; color:#d8dcff; display:block;}
table{width:100%; border-collapse:separate; border-spacing:0; margin:22px 0; font-size:.92em; border-radius:14px; overflow:hidden; border:1px solid var(--border);}
th, td{border-bottom:1px solid var(--border); padding:12px 15px; text-align:right;}
th{background:#eceaf9; color:var(--accent-ink); font-weight:700; font-size:.9em;}
tr:last-child td{border-bottom:none;} tr:nth-child(even) td{background:rgba(33,31,26,0.02);}
ul, ol{margin:0 0 16px; padding-inline-start:26px; color:#3c382f;} li{margin-bottom:7px;}
.figure{margin:28px 0; text-align:center;}
.figure svg{max-width:100%; height:auto; background:#fffefb; border:1px solid var(--border); border-radius:16px; box-shadow:0 1px 2px rgba(33,31,26,0.03), 0 16px 32px -20px rgba(33,31,26,0.14);}
.figure figcaption{color:var(--muted); font-size:.87em; margin-top:12px;}
.mermaid{background:#fffefb; border:1px solid var(--border); border-radius:16px; padding:18px; margin:24px 0; text-align:center; box-shadow:0 1px 2px rgba(33,31,26,0.03), 0 16px 32px -20px rgba(33,31,26,0.14);}
.checkpoint{border-radius:16px; padding:22px 24px; margin:26px 0; background:#eafaf3; border:1px solid #c9eeda;}
.checkpoint ul{list-style:none; padding:0; margin:0;}
.checkpoint li{padding:9px 0; border-bottom:1px solid rgba(33,31,26,0.06); display:flex; gap:10px; align-items:flex-start;}
.checkpoint li:last-child{border-bottom:none;} .checkpoint li::before{content:"◻"; color:var(--accent2); font-size:1.2em; line-height:1;}
.exercise{border-radius:14px; padding:18px 22px; margin:16px 0; background:var(--panel); border:1px solid var(--border); border-inline-start:4px solid var(--gold);}
.exercise .level{font-size:.76em; color:var(--gold); font-weight:800; text-transform:uppercase; letter-spacing:.6px;}
.glossary dt{font-weight:800; color:var(--accent-ink); margin-top:16px;} .glossary dd{margin:4px 0 0; color:var(--muted);}
.toc{background:var(--panel); border:1px solid var(--border); border-radius:20px; padding:26px 30px;}
.toc a{display:block; padding:8px 0; color:#3c382f; text-decoration:none; border-bottom:1px solid rgba(33,31,26,.06); transition:color .15s;}
.toc a:last-child{border-bottom:none;} .toc a:hover{color:var(--accent-ink);}
.toc a span{color:var(--muted); font-size:.85em; margin-inline-end:10px; font-weight:600;}
.divider{height:1px; background:linear-gradient(90deg, transparent, var(--border), transparent); margin:52px 0;}
.footer-nav{display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:64px; padding-top:26px; border-top:1px solid var(--border); color:var(--muted); font-size:.9em;}
.badge-project{display:inline-block; background:#fdf3e4; border:1px solid #f2ddb3; color:var(--gold); border-radius:8px; padding:3px 11px; font-size:.78em; font-weight:700;}
.term{background:#181a2e; border-radius:16px; overflow:hidden; margin:22px 0; box-shadow:0 12px 28px -16px rgba(24,26,46,0.5);}
.term-bar{display:flex; align-items:center; gap:7px; padding:12px 16px; background:#20223a;}
.term-dot{width:11px; height:11px; border-radius:50%;}
.term-body{padding:16px 20px; font-family:'JetBrains Mono', monospace; direction:ltr; text-align:left; font-size:.87em; line-height:1.75; color:#d8dcff;}
.term-prompt{color:#7ee7c7;} .term-out{color:#9aa0c8;}
@media print{ body{background:#fff; color:#000;} }
html[data-theme="dark"]{
--bg:#12141c; --panel:#1b1e2a; --panel2:#20232f; --border:#2d3142;
--text:#e7e8f2; --muted:#9498b3; --accent:#7c86ff; --accent-ink:#aab1ff;
--accent2:#34d399; --gold:#e3a548; --danger:#f0685a; --purple:#a78bfa; --radius:14px;
}
html[data-theme="dark"] p, html[data-theme="dark"] ul, html[data-theme="dark"] ol, html[data-theme="dark"] .toc a{color:#c7c9dc;}
html[data-theme="dark"] code{background:#262a45; border-color:#3a3f5c;}
html[data-theme="dark"] th{background:#262a45;}
html[data-theme="dark"] tr:nth-child(even) td{background:rgba(255,255,255,0.03);}
html[data-theme="dark"] .box.idea{background:#1f2242; border-color:#383d6b;}
html[data-theme="dark"] .box.mistake{background:#3a2220; border-color:#5c332e;}
html[data-theme="dark"] .box.eng{background:#2a2340; border-color:#453a63;}
html[data-theme="dark"] .box.real{background:#16302a; border-color:#1f4a3d;}
html[data-theme="dark"] .box.def{background:#3a2f18; border-color:#5c4826;}
html[data-theme="dark"] .checkpoint{background:#16302a; border-color:#1f4a3d;}
html[data-theme="dark"] .checkpoint li{border-bottom-color:rgba(255,255,255,0.08);}
html[data-theme="dark"] .badge-project{background:#3a2f18; border-color:#5c4826;}
html[data-theme="dark"] .journey-item{background:#1f2242; border-color:#383d6b; color:#aab1ff;}
html[data-theme="dark"] .chapter-num{background:#1f2242;}
html[data-theme="dark"] .chapter-card{box-shadow:0 1px 2px rgba(0,0,0,0.25);}
html[data-theme="dark"] .chapter-card:hover{border-color:#454a7a; box-shadow:0 16px 32px -20px rgba(0,0,0,0.55);}
html[data-theme="dark"] .status-badge[style*="eafaf3"], html[data-theme="dark"] .lifecycle-badge[style*="eafaf3"]{background:#16302a !important; color:#34d399 !important;}
html[data-theme="dark"] .status-badge[style*="fdf3e4"], html[data-theme="dark"] .lifecycle-badge[style*="fdf3e4"]{background:#3a2f18 !important; color:#e3a548 !important;}
html[data-theme="dark"] .status-badge[style*="fdeeec"], html[data-theme="dark"] .lifecycle-badge[style*="fdeeec"]{background:#3a2220 !important; color:#f0685a !important;}
html[data-theme="dark"] .status-badge[style*="f1efe8"], html[data-theme="dark"] .lifecycle-badge[style*="f1efe8"]{background:#20232f !important; color:#9498b3 !important;}
body, .box, .chapter-card, .exercise, .checkpoint, .toc, table, code, th{transition:background-color .25s ease, border-color .25s ease, color .25s ease;}
#theme-toggle{position:fixed; top:18px; left:18px; z-index:999; width:46px; height:46px; border-radius:50%; border:1px solid var(--border); background:var(--panel); color:var(--text); font-size:19px; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 6px 18px -8px rgba(0,0,0,0.35); transition:transform .15s ease, background-color .25s ease, border-color .25s ease;}
#theme-toggle:hover{transform:scale(1.08);}
@media (max-width:640px){ #theme-toggle{top:12px; left:12px; width:42px; height:42px; font-size:17px;} }
</style>
</head>
<body>
<button id="theme-toggle" aria-label="Toggle light/dark mode" title="Light/dark mode">
<span id="theme-toggle-icon">🌙</span>
</button>
<div class="wrap">
<div class="cover">
<div class="kicker">ROS 2 Learning Path · Illustrated Educational Book</div>
<h1>Chapter Fifteen: Docker and CI/CD for ROS 2</h1>
<div class="subtitle">From "it works on my laptop" to a deployable product</div>
<div class="meta-row">
<div class="chip">Prerequisite: Chapter 2 (Workspace/Package)</div>
<div class="chip">Ongoing project: the ARCHO fleet</div>
<div class="chip">Tools: Docker, GitHub Actions</div>
<div class="chip">Reading time: 100–120 minutes</div>
</div>
</div>
<div class="toc">
<strong style="color:var(--text)">What we cover in this chapter</strong>
<a href="#why-docker"><span>15.1</span>Why Docker: "it works on my laptop"</a>
<a href="#dockerfile"><span>15.2</span>Dockerfile for ARCHO</a>
<a href="#gui"><span>15.3</span>The GUI problem: RViz and Gazebo inside a Container</a>
<a href="#compose"><span>15.4</span>Docker Compose for a full run</a>
<a href="#cicd"><span>15.5</span>CI/CD: automated testing on every code change</a>
<a href="#pipeline"><span>15.6</span>A complete GitHub Actions pipeline</a>
<a href="#tests"><span>15.7</span>What kinds of tests are needed</a>
<a href="#summary"><span>15.8</span>Summary, glossary, and exercises</a>
</div>
<section id="why-docker">
<h2><span class="num">15.1</span>Why Docker: "it works on my laptop"</h2>
<p>
Everything we've built for ARCHO so far has been tested on one specific development system with a specific
version of Jazzy installed. But when a colleague wants to run the same project, or you want to deploy the
same code to ten different ARCHO units, a classic problem appears.
</p>
<div class="box mistake">
<div class="box-title">⚠️ The classic software problem</div>
<p>"It works on my laptop" but "it's broken on your system" — because the ROS version, the package versions, or even the operating system version differ.</p>
</div>
<div class="box def">
<div class="box-title">📖 What Docker is</div>
<p>
Docker means packaging the project's entire software environment — the ROS version, dependencies,
packages, and environment variables — into a reproducible <strong>Container</strong>. With Docker,
ARCHO's runtime environment is exactly the same, whether it runs on your laptop, on a colleague's
computer, or on the robot itself.
</p>
</div>
</section>
<div class="divider"></div>
<section id="dockerfile">
<h2><span class="num">15.2</span>Dockerfile for ARCHO</h2>
<pre><code># Dockerfile
FROM ros:jazzy-ros-base
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y \
python3-colcon-common-extensions \
ros-jazzy-navigation2 \
ros-jazzy-nav2-bringup \
ros-jazzy-slam-toolbox \
ros-jazzy-robot-localization \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /archo_ws
COPY src /archo_ws/src
RUN source /opt/ros/jazzy/setup.bash && \
colcon build --symlink-install
COPY docker/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]</code></pre>
<pre><code>#!/bin/bash
# docker/entrypoint.sh
set -e
source /opt/ros/jazzy/setup.bash
if [ -f /archo_ws/install/setup.bash ]; then
source /archo_ws/install/setup.bash
fi
exec "$@"</code></pre>
</section>
<div class="divider"></div>
<section id="gui">
<h2><span class="num">15.3</span>The GUI problem: RViz and Gazebo inside a Container</h2>
<p>
RViz and Gazebo (Chapters 6 and 7) need a real display, and Containers by default have no graphical
interface at all. A few common approaches solve this problem:
</p>
<table>
<tr><th>Approach</th><th>Best for</th></tr>
<tr><td>X11 Forwarding</td><td>Linux, fast for local development</td></tr>
<tr><td>Wayland Forwarding</td><td>Newer Linux distributions</td></tr>
<tr><td>VNC</td><td>Remote access or non-Linux operating systems</td></tr>
<tr><td>Gazebo on the Host, Nodes inside the Container</td><td>Gradual, simplest starting setup</td></tr>
</table>
<div class="box eng">
<div class="box-title">🔧 Recommendation for getting started</div>
<p>
The best starting point is to run Gazebo and RViz directly on Ubuntu and keep only the processing
Nodes (Nav2, SLAM, controllers) inside Docker. Once this combination is stable, you can gradually
containerize the whole system — for example with a Dev Container in VS Code.
</p>
</div>
</section>
<div class="divider"></div>
<section id="compose">
<h2><span class="num">15.4</span>Docker Compose for a full run</h2>
<pre><code># docker-compose.yml
services:
archo:
build: .
network_mode: host
privileged: true
volumes:
- /dev:/dev
environment:
- ROS_DOMAIN_ID=20</code></pre>
<div class="box mistake">
<div class="box-title">⚠️ Use network_mode: host with caution</div>
<p>
This setting greatly simplifies DDS communication between Nodes (because the Containers sit directly
on the Host network), but from a security and environment-isolation standpoint it must be used
deliberately — especially on a robot that is also connected to an external network.
</p>
</div>
<div class="box def">
<div class="box-title">📖 The golden sentence of this section</div>
<p>Docker doesn't simulate the robot itself; it makes the robot's software environment reproducible, deliverable, and deployable.</p>
</div>
</section>
<div class="divider"></div>
<section id="cicd">
<h2><span class="num">15.5</span>CI/CD: automated testing on every code change</h2>
<table>
<tr><th></th><th>Meaning</th></tr>
<tr><td><strong>CI</strong> (Continuous Integration)</td><td>Every time code changes: Build, Test, and Lint run automatically</td></tr>
<tr><td><strong>CD</strong> (Continuous Delivery/Deployment)</td><td>Once CI passes: Package, Deploy, Release</td></tr>
</table>
<div class="box def">
<div class="box-title">📖 The golden sentence of this section</div>
<p>On a professional robot, testing isn't done just before final delivery; it is repeated automatically with every code change.</p>
</div>
</section>
<div class="divider"></div>
<section id="pipeline">
<h2><span class="num">15.6</span>A complete GitHub Actions pipeline</h2>
<pre><code># .github/workflows/ros2-ci.yml
name: ROS 2 CI
on:
push:
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-24.04
container:
image: ros:jazzy-ros-base
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
shell: bash
run: |
apt-get update
apt-get install -y python3-colcon-common-extensions
rosdep update
rosdep install \
--from-paths src \
--ignore-src \
-r -y
- name: Build
shell: bash
run: |
source /opt/ros/jazzy/setup.bash
colcon build --event-handlers console_direct+
- name: Test
shell: bash
run: |
source /opt/ros/jazzy/setup.bash
source install/setup.bash
colcon test
- name: Test results
shell: bash
run: |
colcon test-result --verbose</code></pre>
<div class="mermaid">
flowchart LR
A["Build passed?"] --> B["Test passed?"] --> C["Lint passed?"] --> D["Security scan passed?"] --> E["Merge allowed"]
style E fill:#eafaf3,stroke:#0e9e6e
</div>
<p style="font-size:.92em; color:var(--muted);">Note: the YAML file above only implements the Build and Test stages; the Lint and Security Scan stages are shown in this diagram as part of a complete, realistic Quality Gate, and adding them (for example with <code>ament_lint</code> or security-scanning tools) is left as an exercise.</p>
</section>
<div class="divider"></div>
<section id="tests">
<h2><span class="num">15.7</span>What kinds of tests are needed</h2>
<table>
<tr><th>Test type</th><th>What it checks</th></tr>
<tr><td>Unit Test</td><td>A single small, isolated function or class</td></tr>
<tr><td>Integration Test</td><td>Correct communication between several Nodes</td></tr>
<tr><td>Launch Test</td><td>Does the whole system launch without errors?</td></tr>
<tr><td>Simulation Test</td><td>Does ARCHO correctly follow a specified path in Gazebo?</td></tr>
<tr><td>Regression Test</td><td>Did a new change break a capability that used to work?</td></tr>
</table>
<div class="term">
<div class="term-bar">
<div class="term-dot" style="background:#f66;"></div>
<div class="term-dot" style="background:#fc5;"></div>
<div class="term-dot" style="background:#6c6;"></div>
</div>
<div class="term-body">
<span class="term-prompt">dev@archo:~$</span> docker build -t archo:jazzy .
<span class="term-out">Successfully built 4a1e2c9b8f3d
Successfully tagged archo:jazzy</span>
<span class="term-prompt">dev@archo:~$</span> docker compose up
<span class="term-out">archo-1 | [INFO] [archo_bringup]: All nodes started successfully</span>
</div>
</div>
</section>
<div class="divider"></div>
<section id="summary">
<h2><span class="num">15.8</span>Chapter Fifteen summary</h2>
<p>
ARCHO's code is now packaged into a reproducible Container, and every code change is automatically
built, tested, and checked before it is allowed to merge. That means delivering a new software version
to a real ARCHO unit is no longer a manual, error-prone process from here on.
</p>
<div class="checkpoint">
<strong style="color:var(--text); display:block; margin-bottom:10px;">✅ Learning checkpoint</strong>
<ul>
<li>I can explain exactly what problem Docker solves.</li>
<li>I know why running RViz and Gazebo inside a Container is challenging, and I can name several common solutions.</li>
<li>I can explain the difference between CI and CD.</li>
<li>I know the five common test types in professional ROS 2 projects.</li>
</ul>
</div>
<div class="box real">
<div class="box-title">🌍 Connection to the main project</div>
<p><span class="badge-project">ARCHO project</span> now has a complete Dockerfile and Docker Compose setup for packaging its software, and every new commit is automatically built and tested in GitHub Actions.</p>
</div>
<h3>What the next chapter adds</h3>
<p>In Chapter Sixteen we step out of the software world and turn to ARCHO's own computing hardware: Jetson, Raspberry Pi, and ESP32 — and which kind of processing each one is suited for.</p>
<h3>Chapter Fifteen glossary</h3>
<dl class="glossary">
<dt>Docker</dt><dd>A tool for packaging a software environment into reproducible Containers.</dd>
<dt>Container</dt><dd>A lightweight, isolated runtime environment that includes all of an application's necessary dependencies.</dd>
<dt>Dockerfile</dt><dd>A text file that defines the steps for building a Docker image.</dd>
<dt>Docker Compose</dt><dd>A tool for defining and running several related Containers together.</dd>
<dt>CI (Continuous Integration)</dt><dd>The automated process of building and testing code with every change.</dd>
<dt>CD (Continuous Delivery/Deployment)</dt><dd>The automated process of packaging and releasing a new version once CI has passed.</dd>
<dt>Quality Gate</dt><dd>A set of conditions (Build, Test, Lint, Security) that must be satisfied before a Merge is allowed.</dd>
</dl>
<h3>Chapter Fifteen common mistakes — summary</h3>
<ul>
<li>Using <code>network_mode: host</code> carelessly, without regard to security.</li>
<li>Trying to fully containerize the GUI (RViz/Gazebo) from day one.</li>
<li>Having no tests at all except a final manual check before delivery.</li>
<li>Not pinning dependency versions, which causes the Build to break later on.</li>
</ul>
</section>
<div class="footer-nav">
<div>Chapter 15 of "ROS 2: Zero to Robot"</div>
<div>Next chapter: deploying on hardware — Jetson, Raspberry Pi, ESP32 →</div>
</div>
</div>
<script>
mermaid.initialize({
startOnLoad: true, theme: 'base',
themeVariables: {
background: '#f1efe8', primaryColor: '#eef0ff', primaryTextColor: '#211f1a',
primaryBorderColor: '#3d4bf5', lineColor: '#0e9e6e', secondaryColor: '#f1efe8',
tertiaryColor: '#fffefb', textColor: '#211f1a', fontFamily: 'Inter, -apple-system, sans-serif'
},
flowchart: { curve: 'basis' },
securityLevel: 'loose'
});
</script>
<script>
(function(){
var btn = document.getElementById('theme-toggle');
var icon = document.getElementById('theme-toggle-icon');
function updateIcon(){
var isDark = document.documentElement.getAttribute('data-theme') === 'dark';
icon.textContent = isDark ? '☀️' : '🌙';
}
updateIcon();
btn.addEventListener('click', function(){
var cur = document.documentElement.getAttribute('data-theme');
var next = cur === 'dark' ? 'light' : 'dark';
document.documentElement.setAttribute('data-theme', next);
try{ localStorage.setItem('ros2-book-theme', next); }catch(e){}
updateIcon();
});
})();
</script>
</body>
</html>