-
Notifications
You must be signed in to change notification settings - Fork 22
/
ubuntu_20_foxy_minimal.dockerfile
104 lines (81 loc) · 3.25 KB
/
ubuntu_20_foxy_minimal.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
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
ARG BASE_IMAGE=ubuntu:20.04
FROM ${BASE_IMAGE}
ENV ROS_DISTRO=foxy
ENV ROS_ROOT=foxy_ws
ENV ROS_PYTHON_VERSION=3
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /workspace
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
cmake \
build-essential \
curl \
wget \
gnupg2 \
lsb-release
# Upgrade installed packages
RUN apt update && apt upgrade -y && apt clean
# Install Python3.10
RUN apt update && \
apt install --no-install-recommends -y build-essential software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt install --no-install-recommends -y python3.10 python3.10-dev python3.10-distutils
# # Setting up locale stuff
RUN apt update && apt install locales
RUN locale-gen en_US en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
export LANG=en_US.UTF-8
# Set default Python3 to Python3.10
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
# Pip install stuff
RUN curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.10 get-pip.py --force-reinstall && \
rm get-pip.py
RUN wget --no-check-certificate https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc && apt-key add ros.asc
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
RUN apt update && apt install -y \
python3-pip \
python3-pytest-cov \
python3-rosinstall-generator \
ros-dev-tools \
libbullet-dev \
libasio-dev \
libtinyxml2-dev \
libcunit1-dev
RUN pip3 install setuptools==70.0.0
RUN python3 -m pip install -U \
argcomplete \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
pytest-repeat \
pytest-rerunfailures \
pytest \
lark
RUN python3.10 -m pip uninstall numpy -y
RUN python3.10 -m pip install --upgrade pip
RUN python3.10 -m pip install numpy
RUN mkdir -p ${ROS_ROOT}/src && \
cd ${ROS_ROOT} && \
rosinstall_generator --deps --rosdistro ${ROS_DISTRO} rosidl_runtime_c rcutils rcl rmw tf2 tf2_msgs geometry_msgs nav_msgs std_msgs rosgraph_msgs sensor_msgs vision_msgs rclpy ros2topic ros2pkg ros2doctor ros2run ros2node ros_environment ackermann_msgs example_interfaces > ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
cat ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
vcs import src < ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall
RUN rosdep init && rosdep update
# Build ROS workspace
RUN cd ${ROS_ROOT} && colcon build --merge-install
# Need these to maintain compatibility on non 20.04 systems
RUN cp /usr/lib/x86_64-linux-gnu/libtinyxml2.so* /workspace/foxy_ws/install/lib/
RUN cp /usr/lib/x86_64-linux-gnu/libssl.so* /workspace/foxy_ws/install/lib/
RUN cp /usr/lib/x86_64-linux-gnu/libcrypto.so* /workspace/foxy_ws/install/lib/
# # Next, build the additional workspace
RUN cd ${WORKDIR} && mkdir build_ws
COPY foxy_ws build_ws
# Build the added workspace
RUN /bin/bash -c "source ${ROS_ROOT}/install/setup.sh && cd build_ws && colcon build --packages-select custom_message --merge-install"