diff --git a/Dockerfile b/Dockerfile index d0d33f5f..628a4657 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ /home/${USERNAME}/.ccache \ /home/${USERNAME}/.config \ /home/${USERNAME}/.ignition \ - /home/${USERNAME}/.ros/log && \ + /home/${USERNAME}/.colcon \ + /home/${USERNAME}/.ros && \ chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/ # Install additional dependencies @@ -73,7 +74,6 @@ RUN rm -rf build/serial install/serial FROM base as user-overlay ARG USERNAME -USER ${USERNAME} ARG USER_WS=/home/${USERNAME}/user_overlay_ws ENV USER_WS=${USER_WS} @@ -84,10 +84,8 @@ RUN --mount=type=cache,target=/home/${USERNAME}/.ccache \ . /opt/overlay_ws/install/setup.sh && \ colcon build -# Add the custom entrypoint -COPY ./entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] -RUN echo "source /entrypoint.sh && set +e" >> ~/.bashrc +# Set up the user's .bashrc file and shell. +RUN echo "source ${USER_WS}/install/setup.bash && set +e" >> /home/${USERNAME}/.bashrc CMD ["/usr/bin/bash"] ################################################################### @@ -95,7 +93,10 @@ CMD ["/usr/bin/bash"] ################################################################### FROM base as user-overlay-dev -USER root +ARG USERNAME +ARG USER_WS=/home/${USERNAME}/user_overlay_ws +ENV USER_WS=${USER_WS} + # Install any additional packages for development work # hadolint ignore=DL3008 RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ @@ -106,13 +107,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ gdb \ nano -USER ${USERNAME} -ARG USERNAME -ARG USER_WS=/home/${USERNAME}/user_overlay_ws -ENV USER_WS=${USER_WS} - -# Add the dev entrypoint -COPY ./entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] -RUN echo "source /entrypoint.sh && set +e" >> ~/.bashrc +# Set up the user's .bashrc file and shell. +RUN echo "source /moveit_studio_utils/setup_workspaces.sh && set +e" >> /home/${USERNAME}/.bashrc CMD ["/usr/bin/bash"]