diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index 2bf4300..9b13e12 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -44,7 +44,7 @@ jobs: - name: Maximize build space uses: easimon/maximize-build-space@master with: - root-reserve-mb: 30000 + root-reserve-mb: 35000 remove-dotnet: 'true' remove-android: 'true' remove-haskell: 'true' diff --git a/Dockerfile.jetson b/Dockerfile.jetson index f748814..c010086 100644 --- a/Dockerfile.jetson +++ b/Dockerfile.jetson @@ -6,19 +6,6 @@ ARG ZED_SDK_MAJOR=4 ARG ZED_SDK_MINOR=0 ARG ROS_DISTRO=foxy -### DOWNLOAD HUSARNET ### -FROM ubuntu:20.04 AS husarnet-dds-getter - -ARG TARGETARCH -ARG HUSARNET_DDS_RELEASE="v1.3.5" - -ENV HUSARNET_DDS_DEBUG=FALSE - -RUN apt update && apt install -y \ - curl - -RUN curl -L https://github.com/husarnet/husarnet-dds/releases/download/${HUSARNET_DDS_RELEASE}/husarnet-dds-linux-${TARGETARCH} -o /usr/bin/husarnet-dds - ### BUILD IMAGE ### FROM stereolabs/zed:${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}-devel-l4t-r${L4T_MAJOR}.${L4T_MINOR} AS build @@ -45,6 +32,7 @@ RUN echo "deb http://packages.ros.org/ros2/ubuntu focal main" > /etc/apt/sources # ZED setup RUN apt-get update || true && \ apt-get install --no-install-recommends -y \ + ros-dev-tools \ ros-${ROS_DISTRO}-ros-base \ ros-${ROS_DISTRO}-ament-cmake-clang-format \ ros-${ROS_DISTRO}-image-transport \ @@ -52,15 +40,10 @@ RUN apt-get update || true && \ ros-${ROS_DISTRO}-diagnostic-updater \ ros-${ROS_DISTRO}-xacro \ build-essential \ - git \ - python3-colcon-common-extensions \ python3-colcon-mixin \ - python3-rosdep \ - python3-vcstool \ python3-flake8-docstrings \ python3-pip \ - python3-pytest-cov \ - ros-dev-tools && \ + python3-pytest-cov && \ pip3 install \ argcomplete \ numpy \ @@ -93,12 +76,13 @@ COPY ./healthcheck.cpp /ros2_ws/src/healthcheck_pkg/src/ # Build WORKDIR /ros2_ws RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ - colcon build --parallel-workers $(nproc) --symlink-install \ - --event-handlers console_direct+ --base-paths src \ - --cmake-args ' -DCMAKE_BUILD_TYPE=Release' \ - ' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' \ - ' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"' \ - ' --no-warn-unused-cli' + colcon build --parallel-workers $(nproc) \ + --event-handlers console_direct+ --base-paths src \ + --cmake-args ' -DCMAKE_BUILD_TYPE=Release' \ + ' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' \ + ' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"' \ + ' --no-warn-unused-cli' && \ + rm -rf build log ### RUNTIME IMAGE ### # Reduction from 6.1GB to 3.9GB FROM stereolabs/zed:${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}-runtime-l4t-r${L4T_MAJOR}.${L4T_MINOR} AS runtime @@ -109,8 +93,6 @@ ARG ZED_SDK_MAJOR ARG ZED_SDK_MINOR ARG ROS_DISTRO -COPY --from=build /ros2_ws /ros2_ws - SHELL ["/bin/bash", "-c"] ENV NVIDIA_DRIVER_CAPABILITIES \ @@ -128,6 +110,7 @@ RUN echo "deb http://packages.ros.org/ros2/ubuntu focal main" > /etc/apt/sources # ZED setup RUN apt-get update || true && \ apt-get install --no-install-recommends -y \ + ros-dev-tools \ ros-${ROS_DISTRO}-ros-base \ ros-${ROS_DISTRO}-ament-cmake-clang-format \ ros-${ROS_DISTRO}-image-transport \ @@ -136,15 +119,11 @@ RUN apt-get update || true && \ ros-${ROS_DISTRO}-xacro \ ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ build-essential \ - git \ - python3-colcon-common-extensions \ + curl \ python3-colcon-mixin \ - python3-rosdep \ - python3-vcstool \ python3-flake8-docstrings \ python3-pip \ - python3-pytest-cov \ - ros-dev-tools && \ + python3-pytest-cov && \ pip3 install \ argcomplete \ numpy \ @@ -153,6 +132,7 @@ RUN apt-get update || true && \ rm -rf /var/lib/apt/lists/* # Check dependencies +COPY --from=build /ros2_ws /ros2_ws WORKDIR /ros2_ws RUN apt-get update && \ source /opt/ros/$ROS_DISTRO/setup.bash && \ @@ -173,8 +153,11 @@ COPY ./healthcheck.sh / HEALTHCHECK --interval=2s --timeout=1s --start-period=20s --retries=1 \ CMD ["/healthcheck.sh"] -# Add Husarnet -COPY --from=husarnet-dds-getter /usr/bin/husarnet-dds /usr/bin/husarnet-dds +# Download Husarnet +ARG TARGETARCH +ARG HUSARNET_DDS_RELEASE="v1.3.5" +ENV HUSARNET_DDS_DEBUG=FALSE +RUN curl -L https://github.com/husarnet/husarnet-dds/releases/download/${HUSARNET_DDS_RELEASE}/husarnet-dds-linux-${TARGETARCH} -o /usr/bin/husarnet-dds RUN chmod +x /usr/bin/husarnet-dds # Setup environment variables