-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (66 loc) · 1.82 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM carlostojal/cuda-ros:noetic-cuda12.1.1-ubuntu20.04
ARG LIBRARY_SOURCE_PATH=./CUPREDS_core
ARG DEMO_BAG_PATH=./bags/demo.bag
# environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
ENV PATH=/usr/local/cuda/bin:$PATH
# install dependencies
RUN apt update
RUN apt upgrade -y
RUN apt install -y \
build-essential \
python3 \
python3-catkin-tools \
python3-rosdep \
libpcl-dev \
libopencv-dev \
libeigen3-dev \
vim \
git \
xauth \
wget \
doxygen \
gdb
RUN apt install -y \
ros-noetic-cv-bridge \
ros-noetic-sensor-msgs \
ros-noetic-tf \
ros-noetic-tf2-ros \
ros-noetic-tf2-eigen \
ros-noetic-pcl-conversions \
ros-noetic-geometry-msgs \
ros-noetic-foxglove-bridge
# copy the bag
COPY ${DEMO_BAG_PATH} /catkin_ws/src/CUPREDS_ros/bags/demo.bag
# re-index the bag in case it might be broken
RUN /bin/bash -c "source /opt/ros/noetic/setup.bash && \
rosbag reindex /catkin_ws/src/CUPREDS_ROS/bags/demo.bag"
RUN apt install valgrind -y
# copy the library from host to container
WORKDIR /home/labrob/CUPREDS_core
COPY ${LIBRARY_SOURCE_PATH} /home/labrob/CUPREDS_core
# build the library
RUN mkdir build
WORKDIR /home/labrob/CUPREDS_core/build
RUN cmake ..
RUN make -j8
# install
RUN make install
# copy the ros package and build it
RUN mkdir -p /catkin_ws/src/CUPREDS_ros
COPY ./CUPREDS_ros /catkin_ws/src/CUPREDS_ros
WORKDIR /catkin_ws
# build
RUN /bin/bash -c "source /opt/ros/noetic/setup.bash && \
cd /catkin_ws && \
catkin_make"
# expose ROS master port
EXPOSE 11311
# expose foxglove bridge port
EXPOSE 8765
# launch the aggregator
CMD /bin/bash -c "source /opt/ros/noetic/setup.bash && \
cd /catkin_ws && \
source /catkin_ws/devel/setup.bash && \
roslaunch cupreds docker_demo.launch"