diff --git a/.docker/Dockerfile.CI b/.docker/Dockerfile similarity index 73% rename from .docker/Dockerfile.CI rename to .docker/Dockerfile index 2f1f11d..e1518a4 100644 --- a/.docker/Dockerfile.CI +++ b/.docker/Dockerfile @@ -1,5 +1,8 @@ ARG SCANCONTROL_SDK_VERSION=1.0.0 +################################################################################ +# Build .deb packages for Aravis and scanCONTROL SDK +################################################################################ FROM ubuntu:22.04 AS build ARG SCANCONTROL_SDK_VERSION @@ -67,12 +70,16 @@ RUN mkdir /library_pkgs && \ mv "/scanCONTROL-Linux-SDK/libmescan/builddir/mescan_${SCANCONTROL_SDK_VERSION}-1_amd64.deb" /library_pkgs && \ mv "/scanCONTROL-Linux-SDK/libllt/builddir/llt_${SCANCONTROL_SDK_VERSION}-1_amd64.deb" /library_pkgs -FROM ros:humble-ros-core +################################################################################ +# ros-core and Aravis + scanCONTROL SDK +# for use with CI +################################################################################ +FROM ros:humble-ros-core AS scancontrol-core ARG SCANCONTROL_SDK_VERSION RUN apt-get update && apt-get install -y --no-install-recommends\ - build-essential \ - pkg-config \ + build-essential \ + pkg-config \ && rm -rf /var/lib/apt/lists/* COPY --from=build ["/library_pkgs", "/library_pkgs"] @@ -83,3 +90,17 @@ RUN apt-get update && \ apt install /library_pkgs/llt_${SCANCONTROL_SDK_VERSION}-1_amd64.deb \ && rm -rf /var/lib/apt/lists/* +################################################################################ +# ros-base + Aravis + scanCONTROL SDK + RViz2 +# for use as a base image in development or deployment +################################################################################ +FROM scancontrol-core AS scancontrol-base + +ARG DEBIAN_FRONTEND=noninteractive + +# Install the base release + rviz2 +RUN apt-get update && apt-get install -y --no-install-recommends \ + ros-humble-ros-base \ + ros-humble-rviz2 \ + ros-humble-rviz-default-plugins \ + && rm -rf /var/lib/apt/lists/* diff --git a/.docker/Dockerfile.dev b/.docker/Dockerfile.dev deleted file mode 100644 index c5fb4f6..0000000 --- a/.docker/Dockerfile.dev +++ /dev/null @@ -1,166 +0,0 @@ -########################################### -# Base image -########################################### -FROM ubuntu:22.04 AS base - -ENV DEBIAN_FRONTEND=noninteractive - -# Install language -RUN apt-get update && apt-get install -y \ - locales \ - && locale-gen en_US.UTF-8 \ - && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \ - && rm -rf /var/lib/apt/lists/* -ENV LANG en_US.UTF-8 - -# Install timezone -RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime \ - && export DEBIAN_FRONTEND=noninteractive \ - && apt-get update \ - && apt-get install -y tzdata \ - && dpkg-reconfigure --frontend noninteractive tzdata \ - && rm -rf /var/lib/apt/lists/* - -RUN apt-get update && apt-get -y upgrade \ - && rm -rf /var/lib/apt/lists/* - -# Install common programs -RUN apt-get update && apt-get install -y --no-install-recommends \ - curl \ - gnupg2 \ - lsb-release \ - sudo \ - software-properties-common \ - wget \ - && rm -rf /var/lib/apt/lists/* - -# Install ROS2 base -RUN sudo add-apt-repository universe \ - && curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null \ - && apt-get update && apt-get install -y --no-install-recommends \ - ros-humble-ros-base \ - python3-argcomplete \ - && rm -rf /var/lib/apt/lists/* - -ENV ROS_DISTRO=humble -ENV AMENT_PREFIX_PATH=/opt/ros/humble -ENV COLCON_PREFIX_PATH=/opt/ros/humble -ENV LD_LIBRARY_PATH=/opt/ros/humble/lib -ENV PATH=/opt/ros/humble/bin:$PATH -ENV PYTHONPATH=/opt/ros/humble/lib/python3.10/site-packages -ENV ROS_PYTHON_VERSION=3 -ENV ROS_VERSION=2 -ENV DEBIAN_FRONTEND= - -########################################### -# Develop image -########################################### -FROM base AS dev - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y --no-install-recommends \ - bash-completion \ - build-essential \ - cmake \ - gdb \ - git \ - openssh-client \ - python3-argcomplete \ - python3-pip \ - ros-dev-tools \ - ros-humble-ament-* \ - vim \ - && rm -rf /var/lib/apt/lists/* - -RUN rosdep init || echo "rosdep already initialized" - -ARG USERNAME=ros -ARG USER_UID=1000 -ARG USER_GID=$USER_UID - -# Create a non-root user -RUN groupadd --gid $USER_GID $USERNAME \ - && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ - # Add sudo support for the non-root user - && apt-get update \ - && apt-get install -y sudo \ - && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ - && chmod 0440 /etc/sudoers.d/$USERNAME \ - && rm -rf /var/lib/apt/lists/* - -# Set up autocompletion for user -RUN apt-get update && apt-get install -y git-core bash-completion \ - && echo "if [ -f /opt/ros/${ROS_DISTRO}/setup.bash ]; then source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc \ - && echo "if [ -f /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash ]; then source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash; fi" >> /home/$USERNAME/.bashrc \ - && rm -rf /var/lib/apt/lists/* - -ENV DEBIAN_FRONTEND= -ENV AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 - -########################################### -# Full image -########################################### -FROM dev AS full - -ENV DEBIAN_FRONTEND=noninteractive -# Install the full release -RUN apt-get update && apt-get install -y --no-install-recommends \ - ros-humble-desktop \ - && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND= - -########################################### -# Workspace -########################################### -FROM full AS workspace - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends \ - unzip \ - libxml2-dev cmake libusb-1.0-0-dev gobject-introspection \ - libgtk-3-dev gtk-doc-tools xsltproc libgstreamer1.0-dev \ - libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \ - libgirepository1.0-dev gettext \ - autotools-dev automake intltool libtool \ - meson \ - ninja-build \ - # Clean up - && apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* - - -RUN wget https://github.com/AravisProject/aravis/releases/download/0.8.30/aravis-0.8.30.tar.xz && \ - tar xfJ aravis-0.8.30.tar.xz && \ - rm aravis-0.8.30.tar.xz - -RUN cd aravis-0.8.30 && \ - meson setup build && \ - cd build && \ - ninja && \ - ninja install && \ - ldconfig - -RUN wget https://software.micro-epsilon.com/scanCONTROL-Linux-SDK-1-0-0.zip -O scanCONTROL-Linux-SDK.zip && \ - unzip scanCONTROL-Linux-SDK.zip -d scanCONTROL-Linux-SDK/ && \ - rm scanCONTROL-Linux-SDK.zip - -RUN cd scanCONTROL-Linux-SDK/libmescan/ && \ - meson builddir && \ - cd builddir && \ - ninja install && \ - ldconfig - -RUN cd scanCONTROL-Linux-SDK/libllt/include && \ - wget -q https://raw.githubusercontent.com/Pugens/scancontrol/1105de0ea8a28526b03de488d76821e07bada265/micro_epsilon_scancontrol_driver/include/lltlib/llt.h -O llt.h && \ - cd .. && meson builddir && \ - cd builddir && \ - ninja && \ - ninja install && \ - ldconfig - -ENV DEBIAN_FRONTEND=dialog - -WORKDIR /home/ros/workspace \ No newline at end of file diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index b28b515..ba5bf6c 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -6,7 +6,7 @@ services: container_name: scancontrol-container build: context: . - dockerfile: Dockerfile.dev + dockerfile: Dockerfile user: ros working_dir: /home/ros/workspace # command: > diff --git a/README.md b/README.md index ca1f1d8..ada8749 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,31 @@ The following parameters are available to allow using multiple scanCONTROL devic Encapsulates the same driver class as the scancontrol_driver_node, but instead allows for zero-copy data transfer. The Topics, services and paremeters are the same as described for the scancontrol_driver_node above. +## Docker Images + +This repository provides a `Dockerfile` (in the `.docker` folder) with multiple stages for images with Aravis and the scanCONTROL SDK installed. + +### scancontrol-core +Extends: `[ros-humble-ros-core]` + +- Installed Aravis. +- Installed scanCONTROL SDK. + +```bash +cd .docker +docker build . --target scancontrol-core -t samxl/scancontrol:humble-ros-core +``` + +### scancontrol-base +Extends: `[scancontrol-core]` + +- Installed `ros-humble-ros-base` +- Installed `rviz2`. + +```bash +cd .docker +docker build . --target scancontrol-base -t samxl/scancontrol:humble-ros-base +``` ## Bugs & Feature Requests