-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
50 lines (42 loc) · 1.93 KB
/
Dockerfile.dev
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
# syntax=docker/dockerfile:1.7-labs
FROM ros:humble
SHELL ["/bin/bash", "-c"]
ARG FOLDER_NAME=rc-brain
ARG WORKSPACE_DIR=/home/hogsmeade
WORKDIR $WORKSPACE_DIR
# Source the ROS2 environment automatically when a new shell is created
RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc
RUN echo "source $WORKSPACE_DIR/install/setup.bash" >> ~/.bashrc
# Install dev tools
RUN apt-get update
RUN apt-get install -y curl
RUN curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
RUN cat /etc/apt/trusted.gpg.d/apt.llvm.org.asc
RUN echo $'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main\n' \
$'deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy main\n' \
$'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main\n' \
$'deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main\n' \
$'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main\n' \
$'deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main\n' \
| tee -a /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y clang-format clang-format-19
# Init rosdep and update package index
# for some reason we need to do this
RUN rm /var/lib/dpkg/info/libc-bin.*
RUN apt-get clean
RUN apt-get update
RUN apt-get install -y libc-bin
RUN rosdep update --rosdistro $ROS_DISTRO
RUN mkdir -p src/$FOLDER_NAME
# Install and build build-from-source packages
# We do this as a separate step from the stuff for our code, since that changes more frequently
RUN cd src && \
git clone https://github.com/Slamtec/sllidar_ros2.git && \
cd sllidar_ros2 && \
git checkout 3430009
RUN source /opt/ros/$ROS_DISTRO/setup.bash && rosdep install --from-paths src -r -y
RUN source /opt/ros/$ROS_DISTRO/setup.bash && colcon build
# Install self dependencies with rosdep
COPY --parents ./*/package.xml src/$FOLDER_NAME
RUN source /opt/ros/$ROS_DISTRO/setup.bash && rosdep install --from-paths src -r -y