Pārlūkot izejas kodu

cleanup Dockerfile

Rodja Trappe 1 gadu atpakaļ
vecāks
revīzija
fc501bd5e9

+ 13 - 7
examples/ros2/Dockerfile

@@ -2,22 +2,28 @@ FROM ros:humble-ros-base
 
 
 RUN apt-get update && apt-get install -y \
 RUN apt-get update && apt-get install -y \
     python3-pip \
     python3-pip \
-    python3-dev \
-    build-essential 
+    # python3-dev \
+    # build-essential \
+   && rm -rf /var/lib/apt/lists/*
 
 
 SHELL ["/bin/bash", "-c"]
 SHELL ["/bin/bash", "-c"]
 
 
-RUN pip3 install nicegui pyquaternion
+COPY requirements.txt requirements.txt
+RUN pip3 install -r requirements.txt
 
 
-ADD ros2_ws ros2_ws/
+ADD ros2_ws /ros2_ws
 
 
-RUN cd ros2_ws && \
-    source /opt/ros/humble/setup.bash && \
+WORKDIR /ros2_ws
+
+RUN source /opt/ros/humble/setup.bash && \
     colcon build --symlink-install
     colcon build --symlink-install
 
 
 COPY ros_entrypoint.sh /
 COPY ros_entrypoint.sh /
 
 
+
 EXPOSE 8080
 EXPOSE 8080
+
 ENTRYPOINT ["/ros_entrypoint.sh"]
 ENTRYPOINT ["/ros_entrypoint.sh"]
-CMD ["bash"]
+
+CMD ros2 launch gui main_launch.py
 
 

+ 0 - 1
examples/ros2/docker-compose.yml

@@ -7,4 +7,3 @@ services:
       - 8080:8080
       - 8080:8080
     volumes:
     volumes:
       - ./ros2_ws/src:/ros2_ws/src
       - ./ros2_ws/src:/ros2_ws/src
-    command: ros2 launch gui main_launch.py

+ 2 - 0
examples/ros2/requirements.txt

@@ -0,0 +1,2 @@
+nicegui
+pyquaternion