forked from foxglove/ros-foxglove-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ros1
45 lines (35 loc) · 1.31 KB
/
Dockerfile.ros1
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
ARG ROS_DISTRIBUTION=noetic
FROM ros:$ROS_DISTRIBUTION-ros-base
# Install clang and set as default compiler.
RUN apt-get update && apt-get install -y --no-install-recommends \
clang \
&& rm -rf /var/lib/apt/lists/*
ENV CC=clang
ENV CXX=clang++
# Set environment and working directory
ENV ROS_WS /ros1_ws
WORKDIR $ROS_WS
# Add package.xml so we can install package dependencies.
COPY package.xml src/ros-foxglove-bridge/
# Install rosdep dependencies
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
apt-get update && rosdep update --include-eol-distros && rosdep install -y \
--from-paths \
src \
--ignore-src \
&& rm -rf /var/lib/apt/lists/*
# Add common files and ROS 1 source code
COPY CMakeLists.txt src/ros-foxglove-bridge/CMakeLists.txt
COPY foxglove_bridge_base src/ros-foxglove-bridge/foxglove_bridge_base
COPY nodelets.xml src/ros-foxglove-bridge/nodelets.xml
COPY ros1_foxglove_bridge src/ros-foxglove-bridge/ros1_foxglove_bridge
ARG USE_ASIO_STANDALONE=ON
# Build the Catkin workspace
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
&& catkin_make -DUSE_ASIO_STANDALONE=$USE_ASIO_STANDALONE
# source workspace from entrypoint
RUN sed --in-place \
's|^source .*|source "$ROS_WS/devel/setup.bash"|' \
/ros_entrypoint.sh
# Run foxglove_bridge
CMD ["rosrun", "foxglove_bridge", "foxglove_bridge"]