@@ -91,9 +91,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
9191 && apt clean \
9292 && rm -rf /var/lib/apt/lists/*
9393
94- # Initialize rosdep
95- RUN rosdep init && rosdep update
96-
9794# Pytorch
9895# Used by elevation_mapping_cupy and not rosdep resolvable for cuda version
9996RUN python3 -m pip install -U --extra-index-url https://download.pytorch.org/whl/cu121 \
@@ -192,20 +189,23 @@ RUN distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
192189
193190# Development stage
194191FROM dev as dev2
195- ARG WORKSPACE="/home/ros /workspace"
192+ ARG WORKSPACE="/home/${USERNAME} /workspace"
196193
197194RUN mkdir -p ${WORKSPACE}/src/elevation_mapping_cupy && chown -R ${USER_UID}:${USER_GID} /home/${USERNAME}
198195RUN echo "if [ -f ${WORKSPACE}/install/setup.bash ]; then source ${WORKSPACE}/install/setup.bash; fi" >> /home/ros/.bashrc
199196WORKDIR ${WORKSPACE}
200197
201198# TODO: move up later before commiting
202199# Setup rosdep
203- # COPY extra_rosdeps.yaml /etc/ros/rosdep/sources.list.d/emcupy-rosdeps.yaml
204- RUN ln -s /home/ros/workspace/src/elevation_mapping_cupy/docker/extra_rosdeps.yaml /etc/ros/rosdep/sources.list.d/emcupy-rosdeps.yaml
205- RUN --mount=type=cache,target=/var/cache/apt \
206- rosdep init \
207- && echo "yaml file:///home/ros/workspace/src/elevation_mapping_cupy/docker/extra_rosdeps.yaml" | tee /etc/ros/rosdep/sources.list.d/00-emcupy-rosdeps.list \
208- && rosdep update
200+ # Could cache this, but since we are linking extra-rosdeps.yaml instead of copying this doesn't do anything
201+ # RUN --mount=type=cache,target=/home/${USERNAME}/.ros/rosdep/sources.cache \
202+ RUN rosdep init \
203+ && ln -s ${WORKSPACE}/src/elevation_mapping_cupy/docker/extra_rosdeps.yaml /etc/ros/rosdep/sources.list.d/emcupy-rosdeps.yaml\
204+ && echo "yaml file:///etc/ros/rosdep/sources.list.d/emcupy-rosdeps.yaml" | tee /etc/ros/rosdep/sources.list.d/00-emcupy-rosdeps.list
205+ # Linking only works if you don't run rosdep update here and wait until it is loaded, otherwise can use copy
206+ # The benefit is that you can update the rosdeps in your workspace and they will be used
207+ # COPY docker/extra_rosdeps.yaml /etc/ros/rosdep/sources.list.d/emcupy-rosdeps.yaml
208+ # RUN rosdep update
209209
210210# Switch to non-root user
211211USER $USERNAME
0 commit comments