@@ -44,9 +44,10 @@ RUN apt-get -q update \
44
44
# - Installing blue deps using pip, apt and rosdep
45
45
# - Installs the remaining blue dependencies from blue_robot.repos
46
46
# - Installs deps from rosdep for all src dependencies
47
- # - colcon build
48
47
#
49
- FROM ci AS robot
48
+ # robot_unbuilt **does not** colcon build, to save time
49
+ #
50
+ FROM ci AS robot_unbuilt
50
51
51
52
#
52
53
# Ubuntu 24.04 "Noble", which is used as the base image for
@@ -137,16 +138,19 @@ RUN sudo apt-get -q update \
137
138
&& sudo apt-get clean -y \
138
139
&& sudo rm -rf /var/lib/apt/lists/*
139
140
140
- # Actually build workspace
141
- RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
142
- && colcon build
143
-
144
- RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
141
+ RUN echo "if [ -f ${USER_WORKSPACE}/install/setup.bash ]; then source ${USER_WORKSPACE}/install/setup.bash; fi" >> /home/$USERNAME/.bashrc \
145
142
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc \
146
143
&& echo "source $VIRTUAL_ENV/bin/activate" >> /home/$USERNAME/.bashrc \
147
144
&& echo "\n # Ensure colcon is run in the venv\n alias colcon='python3 -m colcon'" >> /home/$USERNAME/.bashrc
148
145
149
- FROM robot AS desktop
146
+ # Finally, build
147
+ FROM robot_unbuilt AS robot
148
+
149
+ # Actually build workspace
150
+ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
151
+ && colcon build
152
+
153
+ FROM robot_unbuilt AS desktop_unbuilt
150
154
151
155
ENV DEBIAN_FRONTEND=noninteractive
152
156
ENV GZ_VERSION=harmonic
@@ -223,12 +227,6 @@ RUN sudo apt-get -q update \
223
227
&& sudo apt-get clean -y \
224
228
&& sudo rm -rf /var/lib/apt/lists/*
225
229
226
- # For users that build this on a laptop or system with limited RAM,
227
- # Modify the 'colcon build' line to be 'MAKEFLAGS="-j1 -l1" colcon build'
228
- # This will limit the amount of RAM that colcon is allowed to use
229
- RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
230
- && colcon build
231
-
232
230
# Setup the simulation environment variables
233
231
RUN <<EOT cat >> /home/$USERNAME/.bashrc
234
232
@@ -245,6 +243,15 @@ export GZ_SIM_SYSTEM_PLUGIN_PATH=\$HOME/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_P
245
243
export GZ_SIM_RESOURCE_PATH=\$ HOME/ardupilot_gazebo/models:\$ HOME/ardupilot_gazebo/worlds:\$ GZ_SIM_RESOURCE_PATH
246
244
EOT
247
245
246
+
247
+ FROM desktop_unbuilt AS desktop
248
+
249
+ # For users that build this on a laptop or system with limited RAM,
250
+ # Modify the 'colcon build' line to be 'MAKEFLAGS="-j1 -l1" colcon build'
251
+ # This will limit the amount of RAM that colcon is allowed to use
252
+ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
253
+ && colcon build
254
+
248
255
FROM desktop AS desktop-nvidia
249
256
250
257
# Install NVIDIA software
0 commit comments