-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathDockerfile
64 lines (53 loc) · 1.91 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
56
57
58
59
60
61
62
63
64
# Use official Ubuntu 22.04 base image
FROM ubuntu:22.04
#RMW ZENOH experimental flag
ARG EXPERIMENTAL_ZENOH_RMW=FALSE
# Set noninteractive mode for APT
ENV DEBIAN_FRONTEND=noninteractive
# Env setup
ENV SHELL=/bin/bash
SHELL ["/bin/bash", "-c"]
# Install system dependencies
RUN apt-get update && apt-get install -y \
locales \
curl \
git \
&& locale-gen en_US.UTF-8 \
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
# Add ROS 2 apt repository
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" \
| tee /etc/apt/sources.list.d/ros2.list > /dev/null \
&& apt-get update
# Install dependencies
RUN apt-get update -q && \
apt-get install -yq --no-install-recommends \
wget \
software-properties-common \
python3-pip \
python-is-python3 \
python3-argcomplete \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
libpython3-dev \
python3-tk \
ros-humble-ros-base \
ros-dev-tools \
#check if Zenoh should be installed
$(if [ "$EXPERIMENTAL_ZENOH_RMW" = "TRUE" ]; then echo "ros-humble-rmw-zenoh-cpp"; fi) \
&& rm -rf /var/lib/apt/lists/*
# Set up workspace
WORKDIR /ros_ws/src
# Initialize rosdep
RUN rosdep init && rosdep update
# Clone driver code
RUN git clone https://github.com/bdaiinstitute/spot_ros2.git .
RUN git submodule update --init --recursive
# Run install script and pass in the architecture
RUN ARCH=$(dpkg --print-architecture) && echo "Building driver with $ARCH" && /ros_ws/src/install_spot_ros2.sh --$ARCH
# Build packages with Colcon
WORKDIR /ros_ws/
RUN . /opt/ros/humble/setup.sh && \
colcon build --symlink-install