-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.debian12
148 lines (133 loc) · 4.28 KB
/
Dockerfile.debian12
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
ARG from=debian:12-slim
FROM ${from}
ARG CMAKE_INSTALL_PREFIX=/usr/local
ARG NUM_THREADS=8
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# Update all packages
RUN apt-get update && apt-get -y dist-upgrade \
&& \
: "remove cache" && \
rm -rf /var/lib/apt/lists/*
# install system dependencies
RUN apt-get update -y -qq && \
: "system dependencies" && \
apt-get install -y -qq \
\
acl \
aptitude \
autoconf \
automake \
build-essential \
cmake \
curl \
dnsutils \
git \
gnupg2 \
intltool \
libacl1-dev \
libasio-dev \
libblosc1 \
libbondcpp-dev \
libcap-dev \
libcgal-dev \
libeigen3-dev \
libfmt-dev \
liblttng-ust-dev lttng-tools python3-lttng \
libssl-dev \
libtinyxml-dev \
libtinyxml2-dev \
lsb-release \
lttng-tools \
mlocate \
pkg-config \
python3-jinja2 \
python3-lxml \
python3-lark \
python3-numpy \
python3-pip \
python3-psutil \
python3-pygraphviz \
python3-typeguard \
software-properties-common \
tar \
unzip \
wget \
&& \
: "remove cache" && \
rm -rf /var/lib/apt/lists/*
# add the ROS 2 GPG key with apt and setup sources.list
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list' && \
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
# setup environment
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ARG ROS_DISTRO
# Environment variables defined using the ENV instruction always override an ARG instruction of the same name.
ENV ROS_DISTRO=${ROS_DISTRO:-iron}
# ros-base include begin
# https://github.com/osrf/docker_images/blob/master/ros/galactic/ubuntu/focal/ros-core/Dockerfile
# https://github.com/osrf/docker_images/blob/master/ros/iron/ubuntu/jammy/ros-base/Dockerfile
# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
python3-vcstool \
python3-ament-pep257 \
python3-flake8 \
python3-coverage \
&& \
# colcon-devtools>0.2.3 is not released for debian12, so override it with pip
# typing_extensions needs to be >4.7.0, but is available on apt with 4.4.0 only
apt-get remove -y python3-colcon-devtools && \
pip3 install colcon-devtools typing_extensions --break-system-package && \
: "remove cache" && \
rm -rf /var/lib/apt/lists/*
# bootstrap rosdep
RUN rosdep init && \
rosdep update --rosdistro $ROS_DISTRO
# setup colcon mixin and metadata
RUN colcon mixin add default \
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
colcon mixin update && \
colcon metadata add default \
https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
colcon metadata update
# install dependencies via apt
ENV DEBCONF_NOWARNINGS=yes
# install and activate ccache, lld, cppcheck
RUN \
: "install ccache" \
&& apt-get update -y -qq \
&& apt-get -y install --no-install-recommends ccache lld cppcheck \
&& /usr/sbin/update-ccache-symlinks \
&& \
: "remove cache" && \
rm -rf /var/lib/apt/lists/*
# ---- ROS ----
# clone source, ROS core
ENV ROS2_WS=/opt/ros2_ws
RUN mkdir -p $ROS2_WS/src
WORKDIR $ROS2_WS
ADD ros-controls.$ROS_DISTRO.repos .
RUN vcs import --input https://raw.githubusercontent.com/ros2/ros2/$ROS_DISTRO/ros2.repos src &&\
vcs import src < ros-controls.$ROS_DISTRO.repos
# build source, ROS core
RUN colcon \
build \
--mixin release build-testing-off \
--cmake-args --no-warn-unused-cli \
--packages-up-to robot_state_publisher tf2_ros tf2_eigen tf2_kdl tf2_eigen_kdl yaml_cpp_vendor filters \
ros2param ros2interface ros2topic ros2action ros2lifecycle ros2launch ros2run \
xacro diagnostic_updater backward_ros generate_parameter_library angles example_interfaces \
ackermann_msgs trajectory_msgs tf2_msgs tf2_geometry_msgs sensor_msgs geometry_msgs nav_msgs \
sdformat_urdf && \
rm -rf log src build
# add default.yaml to the image
ADD defaults.yaml /root/.colcon/defaults.yaml
# set up sourcing of ros
COPY ./ros_entrypoint.sh /
ENTRYPOINT [ "/ros_entrypoint.sh" ]
CMD ["bash"]