/
SerValera
/
nti_host
Обзор
Документация
Войти
/
SerValera
/
nti_host
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
docker/Dockerfile
246 строк
7 KB
Valerii Serpiva
defore demo flight on the 1th field. tested with 2 drones
14 июл 2026, 23:24
14 июл 2026, 23:24
d4628cd
Код
Авторство
О чём код?
############################################## # ROS2 Humble + DDS cyclon set # Ubuntu 22.04 # HOST DOCKER ############################################## FROM ubuntu:22.04 # ============================================================ # Environment # ============================================================ ENV DEBIAN_FRONTEND=noninteractive ENV LANG=en_US.UTF-8 ENV LC_ALL=en_US.UTF-8 ENV ROS_DISTRO=humble # ============================================================ # System setup # ============================================================ RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ nano \ gettext-base \ gnupg2 \ lsb-release \ sudo \ software-properties-common \ wget \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # ============================================================ # ROS2 repository # ============================================================ RUN curl -L -s \ -o /tmp/ros2-apt-source.deb \ https://github.com/ros-infrastructure/ros-apt-source/releases/download/1.1.0/ros2-apt-source_1.1.0.$(lsb_release -cs)_all.deb \ && dpkg -i /tmp/ros2-apt-source.deb \ && rm -f /tmp/ros2-apt-source.deb # ============================================================ # Core packages # ============================================================ RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ pkg-config \ python3 \ python3-pip \ python3-dev \ python3-argcomplete \ python3-colcon-common-extensions \ python3-rosdep \ gettext-base \ usbutils \ libssl-dev \ libusb-1.0-0-dev \ libudev-dev \ libgtk-3-dev \ libgl1-mesa-dev \ libglu1-mesa-dev \ libx11-dev \ libxrandr-dev \ libxi-dev \ libxinerama-dev \ libxcursor-dev \ libxxf86vm-dev \ libboost-all-dev \ libeigen3-dev \ libgoogle-glog-dev \ libgflags-dev \ libatlas-base-dev \ libsuitesparse-dev \ libceres-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # ============================================================ # ROS2 packages # ============================================================ RUN apt-get update && apt-get install -y --no-install-recommends \ ros-humble-ros-base \ ros-humble-rviz2 \ ros-humble-tf-transformations \ ros-humble-diagnostic-updater \ ros-humble-image-transport \ ros-humble-cv-bridge \ ros-humble-nav-msgs \ ros-humble-geometry-msgs \ ros-humble-sensor-msgs \ ros-humble-domain-bridge \ ros-dev-tools \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # ============================================================ # Python packages # ============================================================ RUN python3 -m pip install --no-cache-dir -U \ pip \ numpy \ psutil # Optional python aliases RUN ln -sf /usr/bin/python3 /usr/bin/python && \ ln -sf /usr/bin/pip3 /usr/bin/pip # ============================================================ # GUI / OpenGL / GStreamer # ============================================================ RUN apt-get update && apt-get install -y --no-install-recommends \ libxext6 \ libx11-6 \ libglvnd0 \ libgl1 \ libglx0 \ libegl1 \ libfuse-dev \ fuse \ libpulse-mainloop-glib0 \ gstreamer1.0-plugins-bad \ gstreamer1.0-libav \ gstreamer1.0-gl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # ============================================================ # NVIDIA support # ============================================================ ENV NVIDIA_VISIBLE_DEVICES=all ENV NVIDIA_DRIVER_CAPABILITIES=graphics,utility,compute # ============================================================ # User setup # ============================================================ ARG USERNAME=nti ARG USER_UID=1000 ARG USER_GID=1000 RUN groupadd --gid ${USER_GID} ${USERNAME} \ && useradd \ --uid ${USER_UID} \ --gid ${USER_GID} \ --create-home \ --shell /bin/bash \ ${USERNAME} \ && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \ && chmod 0440 /etc/sudoers.d/${USERNAME} # ============================================================ # DDS CycloneDDS setup # ============================================================ # Install CycloneDDS RMW implementation RUN apt-get update && apt-get install -y \ ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ && rm -rf /var/lib/apt/lists/* # Create CycloneDDS configuration file RUN mkdir -p /home/nti && \ cat <<EOF > /home/nti/cyclonedds.xml <?xml version="1.0" encoding="UTF-8" ?> <CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd"> <Domain Id="any"> <General> <Interfaces> <NetworkInterface autodetermine="true" priority="default" multicast="default" /> </Interfaces> <AllowMulticast>default</AllowMulticast> <MaxMessageSize>65500B</MaxMessageSize> </General> <Internal> <SocketReceiveBufferSize min="10MB"/> <Watermarks> <WhcHigh>500kB</WhcHigh> </Watermarks> </Internal> </Domain> </CycloneDDS> EOF # Configure kernel/network buffers RUN cat <<EOF > /etc/sysctl.d/60-zed-buffers.conf # IP fragmentation settings net.ipv4.ipfrag_time=3 net.ipv4.ipfrag_high_thresh=134217728 # Increase the maximum receive buffer size for network packets net.core.rmem_max=2147483647 EOF # Apply sysctl settings RUN sysctl -p /etc/sysctl.d/60-zed-buffers.conf || true # ============================================================ # User environment # ============================================================ USER ${USERNAME} ENV HOME=/home/${USERNAME} WORKDIR ${HOME} RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \ echo "if [ -f ~/nti_project/ros2_ws/install/setup.bash ]; then source ~/nti_project/ros2_ws/install/setup.bash; fi" >> ~/.bashrc && \ echo "alias cc='cd ~/nti_project/ros2_ws && colcon build'" >> ~/.bashrc && \ echo "alias ss='source /opt/ros/${ROS_DISTRO}/setup.bash'" >> ~/.bashrc && \ echo "alias sbrc='source ~/.bashrc'" >> ~/.bashrc && \ echo "alias run='/home/nti/nti_project/scripts/run.sh'" >> ~/.bashrc && \ echo "alias stop='tmux kill-session'" >> ~/.bashrc && \ echo "sudo sysctl -p /etc/sysctl.d/60-zed-buffers.conf" >> ~/.bashrc # Set CycloneDDS as default RMW and ROS domain, Export CycloneDDS config path RUN echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.bashrc && \ echo "export ROS_DOMAIN_ID=200" >> ~/.bashrc && \ echo "export CYCLONEDDS_URI=file:///home/nti/cyclonedds.xml" >> ~/.bashrc # TODO: ADD # sudo apt-get install ros-humble-mavros ros-humble-mavros-extras # wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh # chmod a+x install_geographiclib_datasets.sh # sudo bash ./install_geographiclib_datasets.sh # PyQt5 # sudo apt install -y \ # python3-pyqt5 \ # python3-pyqt5.qtopengl \ # python3-pyqtgraph \ # python3-opengl \ # python3-numpy \ # python3-yaml CMD ["bash"]