-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
45 lines (35 loc) · 1.48 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
FROM ros:humble
ARG DEBIAN_FRONTEND=noninteractive
ARG USERNAME=ros_user
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Delete user if it exists in container (e.g Ubuntu Noble: ubuntu)
RUN if id -u $USER_UID ; then userdel `id -un $USER_UID` ; fi
# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y python3-pip python3-colcon-clean git libboost-all-dev liboctomap-dev
# Install libccd
RUN cd /tmp && git clone https://github.com/danfis/libccd.git && cd libccd \
&& mkdir -p build && cd build \
&& cmake -G 'Unix Makefiles' -DENABLE_DOUBLE_PRECISION=ON .. \
&& make -j$(nproc) && sudo make install
# Install FCL
RUN cd /tmp && git clone https://github.com/flexible-collision-library/fcl.git \
&& cd fcl && mkdir -p build && cd build \
&& cmake .. && make -j$(nproc) && sudo make install
# Create ROS workspace
WORKDIR /ros2_ws/src
# Clone robot_collision_checking code
RUN git clone https://github.com/philip-long/robot_collision_checking.git
# Build packages with Colcon
WORKDIR /ros2_ws/
RUN sudo apt-get update && rosdep update && sudo rosdep install \
--rosdistro humble --from-paths src --ignore-src -y
RUN . /opt/ros/humble/setup.sh && \
colcon build --symlink-install