-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (20 loc) · 1.05 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
FROM ros:humble-ros-core
# Install packages and dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
python3-colcon-common-extensions \
ros-humble-robot-localization \
&& rm -rf /var/lib/apt/lists/*
# Copy entrypoint script (which creates ros user with same uid/gid as host user)
COPY ros_entrypoint.sh /ros_entrypoint.sh
WORKDIR /colcon_ws
# Uncomment to copy and build source_packages in colcon workspace
# COPY ./source_packages src/source_packages
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
colcon build --symlink-install --event-handlers console_direct+ --cmake-args ' -DCMAKE_BUILD_TYPE=Release'
# Set package's launch command
ENV LAUNCH_COMMAND='ros2 launch robot_localization ukf.launch.py'
# Create build and run aliases
RUN echo 'alias build="colcon build --symlink-install --event-handlers console_direct+"' >> /etc/bash.bashrc && \
echo 'alias run="su - ros /run.sh"' >> /etc/bash.bashrc && \
echo "source /colcon_ws/install/setup.bash; $LAUNCH_COMMAND" >> /run.sh && chmod +x /run.sh