-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.remote
31 lines (24 loc) · 1006 Bytes
/
Dockerfile.remote
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
# ROS Version
ARG TAG=ros2_humble_opensource
ARG ROS_DISTRO=humble
# Pull ros-ml-container from container registry
FROM ghcr.io/simonschwaiger/ros-ml-container:${TAG}
# Install additional requirements from local file
RUN rm requirements.txt
ADD ./requirements.txt .
RUN /bin/bash -c "source ~/myenv/bin/activate \
&& pip3 install -r requirements.txt"
# Copy ROS packages for compilation in container
COPY ./src/ $ROS2_WS/src/
# Install ros dependencies
RUN apt-get update && rosdep update && rosdep install --from-paths $ROS2_WS/src -i -y --rosdistro $ROS_DISTRO
# Compile workspace (distinguishes between ros 1 and ros 2 build systems)
ARG ROS_DISTRO
RUN /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && cd $ROS2_WS; \
if [ '$ROS_DISTRO' = 'noetic' ]; then \
catkin_make; else \
colcon build --symlink-install; fi"
# Remove src folder used for compilation, since the real src folder will be mounted at runtime
RUN rm -rf $ROS2_WS/src
# Cleanup
RUN rm -rf /var/lib/apt/lists/*