-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (44 loc) · 1.81 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
49
50
51
52
53
54
55
# multi-stage for caching
FROM ros:foxy
# This variable tells future scripts that user input isn't available during the Docker build.
ENV DEBIAN_FRONTEND noninteractive
LABEL maintainer="Nova"
# Steps followed from here: https://carla.readthedocs.io/projects/ros-bridge/en/latest/ros_installation_ros2/
# Clone the carla-ros-bridge repo
RUN mkdir -p /carla-ros-bridge
WORKDIR /carla-ros-bridge
RUN git clone --recurse-submodules https://github.com/carla-simulator/ros-bridge.git src/ros-bridge
# Sourcing ROS (need to run this using bash instead of sh)
RUN /bin/bash -c "source /opt/ros/foxy/setup.bash"
# apt-get & apt installs
# Also need to upgrade the apt packages, otherwise there are incompatibilities running ros2/rviz2
RUN apt-get update && apt update && apt upgrade -y && \
# pip is needed for rosdep install step below
apt-get install -y python3-pip && \
apt install -y \
# required ROS packages for rosdep install step below
ros-foxy-rviz2 \
ros-foxy-cv-bridge \
ros-foxy-pcl-conversions \
ros-foxy-pcl-ros \
ros-foxy-ackermann-msgs \
ros-foxy-rqt-gui-py \
ros-foxy-python-qt-binding \
ros-foxy-derived-object-msgs \
ros-foxy-tf-transformations \
# needed for ros2_numpy package (maybe others)
ros-foxy-ament-cmake-nose \
# cleanup to make image smaller
&& apt clean && rm -rf /var/lib/apt/lists/*
# Now install ROS dependencies
RUN rosdep update && rosdep install --from-paths src --ignore-src -r
# Build the CARLA ROS2 bridge
RUN /bin/bash -c "source /opt/ros/foxy/setup.bash && colcon build"
# RUN useradd -ms /bin/bash docker
RUN usermod -a -G dialout root
RUN usermod -a -G tty root
# USER docker
ENV ROS_VERSION 2
COPY ./docker/entrypoint.sh /entrypoint.sh
WORKDIR /carla_interface
ENTRYPOINT [ "/entrypoint.sh" ]