diff --git a/.docker/Dockerfile b/.docker/Dockerfile index ac603702f6..89176b40b7 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -8,8 +8,10 @@ ARG BASE_BRANCH= ######################### Base Tutorial Image ################################################# -FROM moveit/moveit2:${ROS_DISTRO}-source as base_image +FROM ros:${ROS_DISTRO}-ros-base as base_image +ENV ROS_UNDERLAY /root/ws_moveit/ +WORKDIR $ROS_UNDERLAY # Copy MoveIt sources from docker context COPY . src/moveit2_tutorials @@ -17,18 +19,19 @@ COPY . src/moveit2_tutorials # Commands are combined in single RUN statement with "apt/lists" folder removal to reduce image size # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers RUN --mount=type=cache,target=/root/.ccache/ \ + # Enable ccache + PATH=/usr/lib/ccache:$PATH && \ # Fetch required upstream sources for building vcs import src < /root/ws_moveit/src/moveit2_tutorials/moveit2_tutorials.repos && \ . "/opt/ros/${ROS_DISTRO}/setup.sh" &&\ - . "install/setup.sh" &&\ sudo apt update && rosdep install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y && \ colcon build \ --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ --ament-cmake-args -DCMAKE_BUILD_TYPE=Debug \ - --event-handlers desktop_notification- status- && \ - ccache -s && \ - # Update /ros_entrypoint.sh to source our new workspace - sed -i "s#/opt/ros/\$ROS_DISTRO/setup.bash#$ROS_UNDERLAY/setup.bash#g" /ros_entrypoint.sh + --event-handlers desktop_notification- status- + +# Update /ros_entrypoint.sh to source our new workspace +RUN sed -i "s#/opt/ros/\$ROS_DISTRO/setup.bash#$ROS_UNDERLAY/install/setup.bash#g" /ros_entrypoint.sh ######################### Hello World Tutorial Image ######################################### @@ -54,8 +57,7 @@ RUN --mount=type=cache,target=/root/.ccache/ \ colcon build \ --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ --ament-cmake-args -DCMAKE_BUILD_TYPE=Debug \ - --event-handlers desktop_notification- status- && \ - ccache -s + --event-handlers desktop_notification- status- ######################### Planning Around Objects Image ####################################### @@ -72,8 +74,7 @@ RUN --mount=type=cache,target=/root/.ccache/ \ colcon build \ --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ --ament-cmake-args -DCMAKE_BUILD_TYPE=Debug \ - --event-handlers desktop_notification- status- && \ - ccache -s + --event-handlers desktop_notification- status- ######################### Pick and Place (MTC) Image ######################################### @@ -103,5 +104,4 @@ RUN --mount=type=cache,target=/root/.ccache/ \ colcon build \ --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ --ament-cmake-args -DCMAKE_BUILD_TYPE=Debug \ - --event-handlers desktop_notification- status- && \ - ccache -s + --event-handlers desktop_notification- status- diff --git a/.github/workflows/docker-base.yml b/.github/workflows/docker-base.yml index 838e1e8702..bb3b721700 100644 --- a/.github/workflows/docker-base.yml +++ b/.github/workflows/docker-base.yml @@ -35,7 +35,6 @@ jobs: if: steps.changed-files.outputs.any_changed == 'true' uses: docker/setup-buildx-action@v2 - name: Login to Github Container Registry - if: steps.changed-files.outputs.any_changed == 'true' uses: docker/login-action@v2 with: registry: ghcr.io diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 2b52ecc6db..d19c48f954 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -27,7 +27,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Github Container Registry - if: env.PUSH == 'true' uses: docker/login-action@v2 with: registry: ghcr.io