-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (51 loc) · 1.96 KB
/
Copy pathDockerfile
File metadata and controls
63 lines (51 loc) · 1.96 KB
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
# syntax = docker/dockerfile:1.0-experimental
FROM osrf/ros:melodic-desktop-bionic
# install build dependacies
RUN apt-get update && \
apt-get install -y apt-utils make python-catkin-tools qt5-default ros-melodic-pcl-ros nano curl
# Create third party folder
ARG THIRD_PARTY_PATH=/root/third_party
RUN mkdir $THIRD_PARTY_PATH
WORKDIR $THIRD_PARTY_PATH
RUN rosdep update && \
rosdep install -y \
--from-paths . \
--ignore-src \
--rosdistro ${ROS_DISTRO} \
--as-root=apt:false
RUN rm -rf /var/lib/apt/lists/*
# install third party libs
RUN git clone https://github.com/fada-catec/piloting-mavsdk && \
cd piloting-mavsdk && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j6 && \
make install
RUN git clone https://github.com/fada-catec/qslog.git && \
cd qslog && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j6 && \
make install
# setup workspace
ARG PILOTING_WS=/root/piloting_ws
RUN mkdir -p $PILOTING_WS/src
WORKDIR $PILOTING_WS/src
RUN git clone -b docker_head https://github.com/fada-catec/piloting_grcs.git
WORKDIR $PILOTING_WS
RUN /bin/bash -c '. /opt/ros/$ROS_DISTRO/setup.bash; \
catkin_make -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/ros/$ROS_DISTRO'
RUN cd $PILOTING_WS/build && make install
WORKDIR "/root"
RUN rm -r $PILOTING_WS
RUN rm -r $THIRD_PARTY_PATH
RUN grcs_version="$(curl -s https://raw.githubusercontent.com/fada-catec/piloting_grcs/main/cmake_stuff/versions.cmake | sed -e '1q;d' | sed -e 's/.*"\(.*\)".*/\1/')" && \
echo "GRCS_VERSION=$grcs_version" && \
echo "export GRCS_VERSION=$grcs_version" >> /opt/ros/$ROS_DISTRO/setup.bash
# setup entrypoint
COPY ./entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# set environment variables
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics