forked from space-ros/demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (36 loc) · 1.46 KB
/
Dockerfile
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
FROM ros:humble
# Define a few key variables
ENV USERNAME=spaceros-user
ENV HOME_DIR=/home/spaceros-user
ENV DEMO_DIR=${HOME_DIR}/demo_ws
ENV ROSDISTRO=humble
# Disable prompting during package installation
ARG DEBIAN_FRONTEND=noninteractive
# Get rosinstall_generator
# Using Docker BuildKit cache mounts for /var/cache/apt and /var/lib/apt ensures that
# the cache won't make it into the built image but will be maintained between steps.
RUN sudo apt update && sudo apt install -y python3-pip \
ros-${ROSDISTRO}-control-msgs \
ros-${ROSDISTRO}-rviz-common \
ros-${ROSDISTRO}-rmw-cyclonedds-cpp \
ros-${ROSDISTRO}-geometry-msgs \
ros-${ROSDISTRO}-sensor-msgs \
ros-${ROSDISTRO}-std-msgs \
ros-${ROSDISTRO}-rosidl-typesupport-fastrtps-cpp \
ros-${ROSDISTRO}-rosidl-typesupport-fastrtps-c \
ros-${ROSDISTRO}-rviz2 \
&& sudo rm -rf /var/lib/apt/lists/*
RUN pip install vcstool
RUN mkdir -p ${DEMO_DIR}/src
WORKDIR ${DEMO_DIR}
# Get the source for the dependencies
COPY --chown=${USERNAME}:${USERNAME} demo_manual_pkgs.repos /tmp/
RUN vcs import src < /tmp/demo_manual_pkgs.repos
#RUN sudo apt-get update -y && rosdep install --from-paths src --ignore-src -r -y --rosdistro ${ROSDISTRO}
# Build the demo
RUN /bin/bash -c 'source /opt/ros/${ROSDISTRO}/setup.bash \
&& colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -Wno-dev'
# Setup the entrypoint
COPY ./entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]