-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.base
46 lines (38 loc) · 1.37 KB
/
Dockerfile.base
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
# Use a PyTorch image built specifically for Jetson from https://github.com/dusty-nv/jetson-containers
FROM andors/torch-ros:l4t-r36.3.0
# Set environment variable to prevent apt from hanging
ARG DEBIAN_FRONTEND=noninteractive
# Install ROS2 packages
RUN apt-get update && apt-get install -y \
python3-colcon-common-extensions \
python3-rosdep \
ros-humble-ros-base \
ros-humble-ament-cmake \
ros-humble-ament-cmake-python \
ros-humble-rclpy \
ros-humble-geometry-msgs \
ros-humble-sensor-msgs \
ros-humble-rosidl-default-generators \
ros-humble-std-msgs \
ros-humble-rosidl-default-runtime \
ros-humble-ament-lint-auto \
ros-humble-rmw-cyclonedds-cpp \
ros-dev-tools
# Source ROS setup script
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
# Clone lang-segment-anything from source
WORKDIR /root
RUN git clone https://github.com/luca-medeiros/lang-segment-anything
# Install lang-segment-anything
WORKDIR /root/lang-segment-anything
RUN pip install -e .
WORKDIR /root/setup
# Preinstall AI model so the programs running it don't have to load it every time
RUN <<EOF
echo 'from lang_sam import LangSAM
model = LangSAM(sam_type="vit_b")
print("Model successfully loaded.")' >> main.py
EOF
RUN python main.py
# Default command
CMD ["/bin/bash", "-c", "source /opt/ros/humble/setup.bash && source /root/ros_ws/install/setup.bash"]