-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.rhel9
84 lines (75 loc) · 2.54 KB
/
Dockerfile.rhel9
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
FROM almalinux:9
ARG ROS_DISTRO=rolling
# ROS prerequisites
# see https://docs.ros.org/en/rolling/Installation/RHEL-Install-RPMs.html
RUN dnf install -y langpacks-en glibc-langpack-en
RUN export LANG=en_US.UTF-8
RUN dnf install -y 'dnf-command(config-manager)' epel-release
RUN dnf config-manager --set-enabled crb
# ADD http://packages.ros.org/ros2/rhel/ros2.repo /etc/yum.repos.d/ros2.repo
ADD http://packages.ros.org/ros2-testing/rhel/ros2-testing.repo /etc/yum.repos.d/ros2.repo
RUN dnf makecache -y
RUN dnf install -y \
gcc-c++ \
git \
make \
patch \
python3-colcon-common-extensions \
python3-mypy \
python3-pip \
python3-pydocstyle \
python3-pytest \
python3-pytest-repeat \
python3-pytest-rerunfailures \
python3-rosdep \
python3-setuptools \
python3-vcstool \
wget
# install some pip packages needed for testing and
# not available as RPMs
# use the same versions as on Ubuntu Jammy
RUN python3 -m pip install -U --user \
flake8==4.0.1 \
pyflakes==2.4.0 \
flake8-blind-except==0.1.1 \
flake8-class-newline \
flake8-deprecated \
colcon-mixin
# install ros-base
ENV ROS_DISTRO=${ROS_DISTRO}
RUN dnf install -y ros-${ROS_DISTRO}-ros-base
# install cmake 3.22.1 (the same version as Ubuntu Jammy default). Needed for RSL
RUN \
cd && \
wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz && \
cd /usr && \
tar --strip-components=1 -xzf ~/cmake-3.22.1-linux-x86_64.tar.gz && \
rm ~/cmake-3.22.1-linux-x86_64.tar.gz
# 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
# build generate_parameter_library and other deps from source
ENV ROS2_WS=/opt/ros2_ws
RUN mkdir -p $ROS2_WS/src
WORKDIR $ROS2_WS
ADD ros-controls.rhel9.repos .
RUN vcs import src < ros-controls.rhel9.repos && \
source /opt/ros/$ROS_DISTRO/setup.sh && \
rosdep init && \
rosdep update --rosdistro $ROS_DISTRO && \
rosdep install -iyr --from-path src || true && \
colcon build \
--mixin release build-testing-off \
--cmake-args --no-warn-unused-cli \
--packages-up-to generate_parameter_library pal_statistics && \
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"]