-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (45 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
52 lines (45 loc) · 1.75 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
FROM osrf/ros:noetic-desktop AS rosa-ros1
LABEL authors="Rob Royce"
ENV DEBIAN_FRONTEND=noninteractive
ENV HEADLESS=false
ARG DEVELOPMENT=false
# Install linux packages
RUN apt-get update && apt-get install -y \
ros-$(rosversion -d)-turtlesim \
locales \
xvfb \
python3.9 \
python3-pip \
curl \
build-essential
# Install Rust (required for building tiktoken)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Cleanup disabled for development builds
# RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Upgrade pip first, then install packages
RUN python3.9 -m pip install --upgrade pip
RUN python3.9 -m pip install --break-system-packages python-dotenv catkin_tools
RUN rosdep update && \
echo "source /opt/ros/noetic/setup.bash" >> /root/.bashrc && \
echo "alias start='catkin build && source devel/setup.bash && roslaunch turtle_agent agent.launch'" >> /root/.bashrc && \
echo "export ROSLAUNCH_SSH_UNKNOWN=1" >> /root/.bashrc
COPY . /app/
WORKDIR /app/
# Modify the RUN command to use ARG
RUN /bin/bash -c 'if [ "$DEVELOPMENT" = "true" ]; then \
python3.9 -m pip install --break-system-packages --ignore-installed --user -e .; \
else \
python3.9 -m pip install --break-system-packages --ignore-installed -U jpl-rosa>=1.0.8; \
fi'
CMD ["/bin/bash", "-c", "source /opt/ros/noetic/setup.bash && \
roscore > /dev/null 2>&1 & \
sleep 5 && \
if [ \"$HEADLESS\" = \"false\" ]; then \
rosrun turtlesim turtlesim_node & \
else \
xvfb-run -a -s \"-screen 0 1920x1080x24\" rosrun turtlesim turtlesim_node & \
fi && \
sleep 5 && \
echo \"Run \\`start streaming:=true\\` to build and launch the ROSA-TurtleSim demo.\" && \
/bin/bash"]