@@ -100,15 +100,18 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
100
100
&& cat /tmp/rosdep-core-depend-packages.txt | xargs apt-get install -y --no-install-recommends \
101
101
&& apt-get autoremove -y && rm -rf "$HOME" /.cache
102
102
103
- RUN --mount=type=bind,from=rosdep-depend,source=/autoware/src/core, target=/autoware/src/core \
104
- --mount=type=cache, target=${CCACHE_DIR} \
103
+ RUN --mount=type=cache, target=${CCACHE_DIR} \
104
+ --mount=type=bind,from=rosdep-depend,source=/autoware/src/core, target=/autoware/src/core \
105
105
source /opt/ros/"$ROS_DISTRO" /setup.bash \
106
106
&& du -sh ${CCACHE_DIR} && ccache -s \
107
107
&& colcon build --cmake-args \
108
108
" -Wno-dev" \
109
109
" --no-warn-unused-cli" \
110
+ --merge-install \
111
+ --install-base /opt/autoware \
110
112
--mixin release compile-commands ccache \
111
- && du -sh ${CCACHE_DIR} && ccache -s
113
+ && du -sh ${CCACHE_DIR} && ccache -s \
114
+ && rm -rf /autoware/build
112
115
113
116
FROM autoware-core AS autoware-universe
114
117
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
@@ -125,15 +128,25 @@ RUN --mount=type=ssh \
125
128
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME" /.cache
126
129
127
130
# Build Autoware
128
- RUN --mount=type=bind,from=rosdep-depend,source=/autoware/src,target=/autoware/src \
129
- --mount=type=cache,target=${CCACHE_DIR} \
131
+ # hadolint ignore=SC1091
132
+ RUN --mount=type=cache,target=${CCACHE_DIR} \
133
+ --mount=type=bind,from=rosdep-depend,source=/autoware/src/launcher,target=/autoware/src/launcher \
134
+ --mount=type=bind,from=rosdep-depend,source=/autoware/src/param,target=/autoware/src/param \
135
+ --mount=type=bind,from=rosdep-depend,source=/autoware/src/sensor_component,target=/autoware/src/sensor_component \
136
+ --mount=type=bind,from=rosdep-depend,source=/autoware/src/sensor_kit,target=/autoware/src/sensor_kit \
137
+ --mount=type=bind,from=rosdep-depend,source=/autoware/src/universe,target=/autoware/src/universe \
138
+ --mount=type=bind,from=rosdep-depend,source=/autoware/src/vehicle,target=/autoware/src/vehicle \
130
139
source /opt/ros/"$ROS_DISTRO" /setup.bash \
140
+ && source /opt/autoware/setup.bash \
131
141
&& du -sh ${CCACHE_DIR} && ccache -s \
132
142
&& colcon build --cmake-args \
133
143
" -Wno-dev" \
134
144
" --no-warn-unused-cli" \
145
+ --merge-install \
146
+ --install-base /opt/autoware \
135
147
--mixin release compile-commands ccache \
136
- && du -sh ${CCACHE_DIR} && ccache -s
148
+ && du -sh ${CCACHE_DIR} && ccache -s \
149
+ && rm -rf /autoware/build
137
150
138
151
CMD ["/bin/bash" ]
139
152
@@ -147,7 +160,6 @@ RUN --mount=type=ssh \
147
160
&& pip uninstall -y ansible ansible-core \
148
161
&& apt-get autoremove -y && rm -rf "$HOME" /.cache
149
162
150
- COPY src /autoware/src
151
163
# Create entrypoint
152
164
COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh
153
165
RUN chmod +x /ros_entrypoint.sh
@@ -179,11 +191,11 @@ RUN --mount=type=ssh \
179
191
/etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/nvidia-docker.list \
180
192
/usr/include /usr/share/doc /usr/lib/gcc /usr/lib/jvm /usr/lib/llvm*
181
193
182
- COPY --from=autoware-universe /autoware/install/ /autoware/install/
194
+ COPY --from=autoware-universe /opt/autoware /opt/autoware
183
195
184
196
# Copy bash aliases
185
197
COPY docker/etc/.bash_aliases /root/.bash_aliases
186
- RUN echo "source /autoware/install /setup.bash" > /etc/bash.bashrc
198
+ RUN echo "source /opt/autoware /setup.bash" > /etc/bash.bashrc
187
199
188
200
# Create entrypoint
189
201
COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh
0 commit comments