You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example above uses consists of three sequential stages. The `cacher` stage first updates the apt lists and ROS index, uses [`vcstool`](https://github.com/dirk-thomas/vcstool) to clone a demo repo into the workspace source directory, and derives build and runtime dependencies sets using [`rosdep`](https://docs.ros.org/en/rolling/Tutorials/Intermediate/Rosdep.html). The `builder` stage apt installs the derived build dependencies, sources the ROS install underlay, and compiles the source via release mode using [`colcon`](https://docs.ros.org/en/rolling/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.html). Finally, `runner` stage apt installs only runtime dependencies, copies the compiled workspace artifacts, and sets up the environment to launch the demo. Note the example consists of several subtle optimizations:
135
135
136
-
-Multi Stage Build
137
-
-Dependency derivation, compilation, and runtime setup are partitioned
138
-
-Maximums cache retention despite package source or build/runtime changes
139
-
-Greater concurrency, e.g: colcon build while runtime apt instals
140
-
-Persistent Cache Propagation
141
-
-Use of [`--mount`](https://docs.docker.com/engine/reference/builder/#run---mount) to cache temp data without bloating layers
142
-
-Maintain temporally consistent apt lists between parallel stages
143
-
-Avoid needless network IO between stages or across docker rebuilds
144
-
-Minimal Image Size
145
-
-Final stage builds from `ros-core` for smallest runtime image
146
-
-Builds and installs for just selected packages amongst workspace
147
-
-Only workspace install artifacts are copied into final layers
136
+
-Multi Stage Build
137
+
- Dependency derivation, compilation, and runtime setup are partitioned
138
+
- Maximums cache retention despite package source or build/runtime changes
139
+
- Greater concurrency, e.g: colcon build while runtime apt instals
140
+
-Persistent Cache Propagation
141
+
- Use of [`--mount`](https://docs.docker.com/engine/reference/builder/#run---mount) to cache temp data without bloating layers
142
+
- Maintain temporally consistent apt lists between parallel stages
143
+
- Avoid needless network IO between stages or across docker rebuilds
144
+
-Minimal Image Size
145
+
- Final stage builds from `ros-core` for smallest runtime image
146
+
- Builds and installs for just selected packages amongst workspace
147
+
- Only workspace install artifacts are copied into final layers
148
148
149
149
For comparison, the resulting `runner` image is similar in size to the earlier `installer` example. This allows you to develop and distribute custom ROS packages without significantly increasing image size compared to pre-built Debian installations:
0 commit comments