-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (56 loc) · 1.9 KB
/
Dockerfile
File metadata and controls
65 lines (56 loc) · 1.9 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM ros:foxy-ros-base
# Set the working directory
WORKDIR /workspace
# Install ROS 2 and Python dependencies
RUN apt-get update && apt-get install -y \
python3-pip \
python3-setuptools \
python3-colcon-common-extensions \
ros-foxy-rclpy \
ros-foxy-std-msgs \
ros-foxy-geometry-msgs \
ros-foxy-sensor-msgs \
ros-foxy-nav-msgs \
ros-foxy-launch \
ros-foxy-launch-ros \
ros-foxy-rviz2 \
ros-foxy-ament-cmake-python \
python3-pytest \
&& rm -rf /var/lib/apt/lists/*
# Copy the package files into the container
COPY . .
# Create a minimal CMakeLists.txt to satisfy colcon
RUN echo 'cmake_minimum_required(VERSION 3.5)' > CMakeLists.txt && \
echo 'project(autodrive_f1tenth)' >> CMakeLists.txt && \
echo 'find_package(ament_cmake REQUIRED)' >> CMakeLists.txt && \
echo 'ament_package()' >> CMakeLists.txt
# Install all the Python dependencies from the README
RUN python3 -m pip install \
eventlet==0.33.3 \
Flask==1.1.1 \
Flask-SocketIO==4.1.0 \
python-socketio==4.2.0 \
python-engineio==3.13.0 \
greenlet==1.0.0 \
gevent==21.1.2 \
gevent-websocket==0.10.1 \
Jinja2==3.0.3 \
itsdangerous==2.0.1 \
werkzeug==2.0.3 \
attrdict \
numpy \
pillow \
opencv-contrib-python \
pynput \
flake8
# Fix setuptools and importlib_metadata compatibility issue
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install setuptools==59.6.0 importlib_metadata==4.8.3 wheel
# Install the package in development mode
RUN . /opt/ros/foxy/setup.sh && \
python3 -m pip install -e src/autodrive_f1tenth
# Build the ROS 2 workspace with detailed output
# RUN . /opt/ros/foxy/setup.sh && \
# colcon build --packages-select autodrive_f1tenth --event-handlers console_direct+
# Source the ROS 2 setup script and workspace
CMD ["bash", "-c", "source /opt/ros/foxy/setup.sh && source install/setup.bash && exec bash"]