Skip to content

Instantly share code, notes, and snippets.

@dpfrakes
Created August 16, 2024 21:40
Show Gist options
  • Save dpfrakes/df5b40c50d6a5942fcaf63b9be7f0737 to your computer and use it in GitHub Desktop.
Save dpfrakes/df5b40c50d6a5942fcaf63b9be7f0737 to your computer and use it in GitHub Desktop.
Dockerfile for ROS2 Iron (ros-core)
# Use the official ros-core image for Ubuntu 24.04 (Iron release if available)
FROM ros:iron-ros-core
# Alternatively, you can use a previous LTS version if Iron is not available
# FROM ros:humble-ros-core
# Install any additional tools or dependencies you need
# RUN apt-get update && apt-get install -y \
# <additional-packages>
# Source the ROS environment
SHELL ["/bin/bash", "-c"]
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc
# Set up a workspace directory
WORKDIR /root/ros2_ws
# Optionally, initialize the workspace
# RUN mkdir -p src && \
# colcon build
# Default command to run when starting the container
CMD ["bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment