diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2fe2cc6..f4f4726 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -45,4 +45,7 @@ FROM depbuilder as final USER $USER +# include the file to configure the user's .bashrc +INCLUDE .devcontainer/docker_include/bashrc_config.dockerfile + CMD ["/bin/bash"] \ No newline at end of file diff --git a/.devcontainer/docker_include/bashrc_config.dockerfile b/.devcontainer/docker_include/bashrc_config.dockerfile new file mode 100644 index 0000000..de002af --- /dev/null +++ b/.devcontainer/docker_include/bashrc_config.dockerfile @@ -0,0 +1,4 @@ +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \ + echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc && \ + echo "export _colcon_cd_root=${COLCON_WS}" >> ~/.bashrc && \ + echo "source ${COLCON_WS}/install/setup.bash" >> ~/.bashrc diff --git a/.devcontainer/docker_include/user_install.dockerfile b/.devcontainer/docker_include/user_install.dockerfile index e325e80..156265e 100644 --- a/.devcontainer/docker_include/user_install.dockerfile +++ b/.devcontainer/docker_include/user_install.dockerfile @@ -17,6 +17,6 @@ COPY .devcontainer/scripts/install_external_ros_packages.sh ${COLCON_WS}/src/ins # Make the script executable and run it, then remove it RUN /bin/bash -c '${COLCON_WS}/src/install_external_ros_packages.sh ${COLCON_WS}' && \ rm -f ${COLCON_WS}/src/install_external_ros_packages.sh && \ - rm -f -r ${COLCON_WS}/src/repos + sudo rm -f -r ${COLCON_WS}/src/repos USER root \ No newline at end of file