From ba7ab1cc827f183a13bbdbe792a746301d964f69 Mon Sep 17 00:00:00 2001 From: kuralme Date: Tue, 9 Jan 2024 21:46:01 +0300 Subject: [PATCH] add docker and make file --- Dockerfile | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 11 +++++++++++ 2 files changed, 67 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c9528a93 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,56 @@ +# Use the official ROS Melodic base image +FROM ros:melodic + +# Set the working directory +WORKDIR /workspace + +# Install additional dependencies if needed +# For example, you can uncomment the line below to install a package +# Install additional dependencies +RUN apt-get update \ + && apt-get -y --quiet --no-install-recommends install \ + gcc \ + git \ + libxml2-dev \ + libxslt-dev \ + libarmadillo-dev \ + ros-melodic-nlopt \ + python3 \ + python3-pip \ + libeigen3-dev\ + libpcl-dev \ + ros-melodic-pcl-conversions \ + libopencv-dev \ + ros-melodic-cv-bridge \ + ros-melodic-tf\ + ros-melodic-interactive-markers\ + ros-melodic-image-geometry\ + ros-melodic-pcl-ros \ + ros-melodic-geometry-msgs \ + ros-melodic-laser-geometry \ + ros-melodic-rviz + +RUN pip3 install setuptools + +RUN pip3 install catkin-tools +# Copy your ROS packages into the workspace +COPY . /workspace/src/ + +WORKDIR /workspace + + +# Set environment variables +ENV ROS_DISTRO melodic +ENV ROS_VERSION 1 +# RUN catkin build +RUN . /opt/ros/melodic/setup.sh && catkin_make + + +# Source the ROS setup file +RUN echo "source /workspace/devel/setup.bash" >> ~/.bashrc + +# Expose ROS master port +EXPOSE 11311 + +# Set entry point to start ROS +CMD ["roscore"] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..ff7c2350 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +# Build docker project +.PHONY : docker_build +docker_build: + docker build -t fastplanner . + +# Run docker project +.PHONY : docker_run +docker_run: + docker run -it --network host --entrypoint /bin/bash fastplanner + + \ No newline at end of file