-
Notifications
You must be signed in to change notification settings - Fork 32
/
Dockerfile
91 lines (77 loc) · 2.24 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
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
FROM ubuntu:18.04
LABEL maintainer="alberto dot soragna at gmail dot com"
# working directory
ENV HOME /root
WORKDIR $HOME
# Set timezone otherwise tz will ask for it
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# general utilities
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
vim \
nano \
python3-pip
# pip
RUN pip3 install --upgrade pip
# Locale options
RUN apt-get install -y locales
RUN locale-gen en_US en_US.UTF-8
RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
# Setup sources
RUN apt-get update && apt-get install -y curl gnupg2 lsb-release
RUN curl http://repo.ros2.org/repos.key | apt-key add -
RUN 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'
RUN apt-get update
# install development tools and ROS tools
RUN apt-get install -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-pip \
python-rosdep \
python3-vcstool \
wget
# install python packages for testing
RUN python3 -m pip install -U \
argcomplete \
flake8 \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
git+https://github.com/lark-parser/lark.git@0.7b \
pytest-repeat \
pytest-rerunfailures \
pytest \
pytest-cov \
pytest-runner \
setuptools
# install Fast-RTPS dependencies
RUN apt-get install --no-install-recommends -y \
libasio-dev \
libtinyxml2-dev
# get ROS2 code
RUN mkdir -p ros2_ws/src
WORKDIR $HOME/ros2_ws
RUN wget https://raw.githubusercontent.com/ros2/ros2/release-latest/ros2.repos
RUN vcs-import src < ros2.repos
# install dependencies using rosdep
RUN rosdep init
RUN rosdep update
RUN rosdep install --from-paths src --ignore-src --rosdistro crystal -y --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers"
# build ros2 sdk workspace
RUN colcon build --symlink-install
# source everything
WORKDIR $HOME
RUN echo ' \n\
echo "Sourcing ROS2 packages..." \n\
source /root/ros2_ws/install/setup.sh ' >> $HOME/.bashrc