-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.ros2
85 lines (71 loc) · 2.09 KB
/
Dockerfile.ros2
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
ARG UBUNTU_RELEASE_YEAR
ARG ZED_SDK_MAJOR
ARG ZED_SDK_MINOR
ARG CUDA_MAJOR
ARG CUDA_MINOR
FROM stereolabs/zed:${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}-gl-devel-cuda${CUDA_MAJOR}.${CUDA_MINOR}-ubuntu${UBUNTU_RELEASE_YEAR}.04
ARG ROS_DISTRO_ARG
ENV LOGNAME root
ENV ROS_DISTRO ${ROS_DISTRO_ARG}
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# install packages
RUN apt-get update || true && apt-get install -q -y --no-install-recommends \
bash-completion \
dirmngr \
gnupg2 \
lsb-release \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# setup sources.list and keys
RUN echo "deb http://packages.ros.org/ros2/ubuntu focal main" > /etc/apt/sources.list.d/ros2-latest.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# install bootstrap tools
RUN apt-get update || true && apt-get install --no-install-recommends -y \
build-essential \
git \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
python3-vcstool \
&& rm -rf /var/lib/apt/lists/*
# install python packages
RUN pip3 install -U \
argcomplete \
flake8 \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
pytest-repeat \
pytest-rerunfailures
# bootstrap rosdep
RUN rosdep init \
&& rosdep update
# 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
# clone source
ENV ROS2_WS /opt/ros2_ws
RUN mkdir -p $ROS2_WS/src
WORKDIR $ROS2_WS
# build source
RUN colcon \
build \
--cmake-args \
-DSECURITY=ON --no-warn-unused-cli \
--symlink-install
# setup bashrc
RUN cp /etc/skel/.bashrc ~/
# setup entrypoint
COPY ./ros_entrypoint.sh /
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]