-
Notifications
You must be signed in to change notification settings - Fork 215
/
Dockerfile-2.4.base
320 lines (286 loc) · 10.6 KB
/
Dockerfile-2.4.base
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu18.04
ARG VIRTUALGL_VERSION=2.6.80
ARG TURBOVNC_VERSION=2.2.80
# Make all NVIDIA GPUS visible
ARG NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES all
# Setup NON INTERACTIVE ENVIRONMENT
ARG DEBIAN_FRONTEND=noninteractive
# Install locales to prevent errors
RUN apt-get clean && \
apt-get update && \
apt-get install --no-install-recommends -y locales && \
rm -rf /var/lib/apt/lists/* && \
locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Install desktop and tools
RUN apt-get update && apt-get install -y \
software-properties-common \
apt-utils \
build-essential make gcc git \
ca-certificates \
curl wget \
gzip zip unzip \
libc6-dev libglu1 libglu1:i386 libegl1-mesa libegl1-mesa:i386 \
libsm6 libxv1 libxv1:i386 libpci3 \
python python-numpy python3 python3-numpy libpython-dev \
x11-xkb-utils xauth xfonts-base xkb-data \
libxtst6 libxtst6:i386 \
mlocate \
nano vim \
htop net-tools \
xterm rsync \
lubuntu-core lubuntu-desktop && \
rm -rf /var/lib/apt/lists/*
# Install VirtualGL and TurboVNC
RUN curl -fsSL -O https://s3.amazonaws.com/virtualgl-pr/dev/linux/virtualgl_${VIRTUALGL_VERSION}_amd64.deb && \
curl -fsSL -O https://s3.amazonaws.com/virtualgl-pr/dev/linux/virtualgl32_${VIRTUALGL_VERSION}_amd64.deb && \
apt-get update && apt-get install -y --no-install-recommends ./virtualgl_${VIRTUALGL_VERSION}_amd64.deb ./virtualgl32_${VIRTUALGL_VERSION}_amd64.deb && \
rm virtualgl_${VIRTUALGL_VERSION}_amd64.deb virtualgl32_${VIRTUALGL_VERSION}_amd64.deb && \
chmod u+s /usr/lib/libvglfaker.so && \
chmod u+s /usr/lib/libdlfaker.so && \
chmod u+s /usr/lib32/libvglfaker.so && \
chmod u+s /usr/lib32/libdlfaker.so && \
chmod u+s /usr/lib/i386-linux-gnu/libvglfaker.so && \
chmod u+s /usr/lib/i386-linux-gnu/libdlfaker.so && \
curl -fsSL -O https://s3.amazonaws.com/turbovnc-pr/dev/linux/turbovnc_${TURBOVNC_VERSION}_amd64.deb && \
apt-get update && apt-get install -y --no-install-recommends ./turbovnc_${TURBOVNC_VERSION}_amd64.deb && \
rm turbovnc_${TURBOVNC_VERSION}_amd64.deb && \
rm -rf /var/lib/apt/lists/* && \
echo -e "no-remote-connections\n\
no-httpd\n\
no-x11-tcp-connections\n\
no-pam-sessions\n\
permitted-security-types = None, VNC, otp\
" > /etc/turbovncserver-security.conf
# Set paths for VirtualGL and turboVNC
ENV PATH "$PATH:/opt/VirtualGL/bin:/opt/TurboVNC/bin"
# Install noVNC and Websockify
RUN git clone https://github.com/novnc/noVNC.git -b v1.2.0 && \
cd noVNC/utils && \
git clone https://github.com/novnc/websockify websockify -b v0.9.0
# Xorg segfault error mitigation
RUN apt-get update && apt-get install -y --no-install-recommends \
dbus-x11 \
libdbus-c++-1-0v5 && \
rm -rf /var/lib/apt/lists/*
# PX4
# RUN apt remove modemmanager
RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
bzip2 \
ca-certificates \
ccache \
cmake \
cppcheck \
curl \
dirmngr \
doxygen \
exiftool \
file \
g++ \
gcc \
gdb \
genromfs \
git \
gnupg \
gosu \
lcov \
libfreetype6-dev \
libgtest-dev \
libpng-dev \
libssl-dev \
lsb-release \
make \
ninja-build \
openjdk-8-jdk \
openjdk-8-jre \
openssh-client \
pkg-config \
python3-dev \
python3-pip \
qtcreator \
rsync \
shellcheck \
tzdata \
unzip \
valgrind \
wget \
xsltproc \
zip \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
RUN which xxd || apt install xxd -y || apt install vim-common --no-install-recommends -y
# gtest
RUN apt-get update && apt-get install -y libgtest-dev cmake && \
cd /usr/src/gtest \
&& mkdir build && cd build \
&& cmake .. && make -j$(nproc) \
&& cp *.a /usr/lib \
&& cd .. && rm -rf build \
rm -rf /var/lib/apt/lists/*
# Install Python 3 pip build dependencies first.
RUN pip3 install wheel setuptools
# Python 3 dependencies installed by pip
RUN pip3 install argparse argcomplete coverage cerberus empy jinja2 \
matplotlib==3.0.* numpy nunavut packaging pkgconfig pyros-genmsg pyulog \
pyyaml requests serial six toml psutil pyulog wheel
# manual ccache setup
RUN ln -sf /usr/bin/ccache /usr/lib/ccache/cc \
&& ln -sf /usr/bin/ccache /usr/lib/ccache/c++
# astyle v3.1
RUN wget -q https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1/astyle_3.1_linux.tar.gz -O /tmp/astyle.tar.gz \
&& cd /tmp && tar zxf astyle.tar.gz && cd astyle/src \
&& make -f ../build/gcc/Makefile -j$(nproc) && cp bin/astyle /usr/local/bin \
&& rm -rf /tmp/*
# Gradle (Required to build Fast-RTPS-Gen)
RUN wget -q "https://services.gradle.org/distributions/gradle-6.3-rc-4-bin.zip" -O /tmp/gradle-6.3-rc-4-bin.zip \
&& mkdir /opt/gradle \
&& cd /tmp \
&& unzip -d /opt/gradle gradle-6.3-rc-4-bin.zip \
&& rm -rf /tmp/*
ENV PATH "/opt/gradle/gradle-6.3-rc-4/bin:$PATH"
# Fast-RTPS 1.8.2
RUN git clone --recursive https://github.com/eProsima/Fast-DDS.git -b v1.8.2 /tmp/FastRTPS-1.8.2 \
&& cd /tmp/FastRTPS-1.8.2 \
&& mkdir build && cd build \
&& cmake -DTHIRDPARTY=ON -DSECURITY=ON .. \
&& cmake --build . --target install -- -j $(nproc) \
&& rm -rf /tmp/*
# Fast-RTPS-Gen 1.0.4
RUN git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git -b v1.0.4 /tmp/Fast-RTPS-Gen-1.0.4 \
&& cd /tmp/Fast-RTPS-Gen-1.0.4 \
&& gradle assemble \
&& gradle install \
&& rm -rf /tmp/*
# Install ROS and ROS packages
ENV ROS_DISTRO melodic
RUN apt-get update && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \
&& sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list' \
&& sh -c 'echo "deb http://packages.ros.org/ros-shadow-fixed/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-shadow.list' \
&& apt-get update \
&& apt-get -y --quiet --no-install-recommends install \
ros-$ROS_DISTRO-desktop-full \
geographiclib-tools \
libeigen3-dev \
libgeographic-dev \
libopencv-dev \
libyaml-cpp-dev \
python-pip \
python-tk \
ros-$ROS_DISTRO-gazebo-ros-pkgs \
ros-$ROS_DISTRO-jderobot-drones \
ros-$ROS_DISTRO-mav-msgs \
ros-$ROS_DISTRO-mavlink \
ros-$ROS_DISTRO-mavros \
ros-$ROS_DISTRO-mavros-extras \
ros-$ROS_DISTRO-octomap \
ros-$ROS_DISTRO-octomap-msgs \
ros-$ROS_DISTRO-pcl-conversions \
ros-$ROS_DISTRO-pcl-msgs \
ros-$ROS_DISTRO-pcl-ros \
ros-$ROS_DISTRO-ros-base \
ros-$ROS_DISTRO-rostest \
ros-$ROS_DISTRO-rosunit \
ros-$ROS_DISTRO-xacro \
&& geographiclib-get-geoids egm96-5 \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
# Install everything again for Python 2 because we could not get Firmware
# to compile using catkin without it.
ENV PIP_DEFAULT_TIMEOUT=1000
RUN pip install wheel setuptools
RUN pip install argcomplete argparse catkin_pkg catkin-tools cerberus coverage
RUN pip install packaging pyros-genmsg pyulog==0.8.* pyyaml requests rosdep rospkg serial six toml
RUN pip install empy jinja2 matplotlib==2.2.* numpy pkgconfig px4tools pygments
RUN pip install pymavlink
# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
python-rosdep \
python-rosinstall \
python-vcstools \
&& rm -rf /var/lib/apt/lists/*
# bootstrap rosdep
RUN rosdep init && rosdep update
# catkin build tools
RUN apt-get update && apt-get install -y \
python-pyproj \
python-catkin-tools \
&& apt-get clean
# PX4 src
RUN apt-get update && \
apt upgrade -y --quiet --no-install-recommends libignition-math2
RUN git clone --recursive https://github.com/PX4/Firmware.git -b v1.11.3
#TOD0 https://github.com/PX4/PX4-Autopilot/issues/13117
RUN sudo apt-get install libgstreamer-plugins-base1.0-dev -y
RUN cd /Firmware \
&& DONT_RUN=1 make px4_sitl_default gazebo \
&& rm -rf /var/lib/apt/lists/*
#---------------------------------------------------------------------
# Certain Dependencies for Exercises
#---------------------------------------------------------------------
RUN apt-get update && \
# Vacuum Cleaner Exercise
apt-get -y --quiet install ros-melodic-kobuki-msgs && \
# Drone-cat-mouse
apt-get -y --quiet --no-install-recommends install xmlstarlet && \
# Follow Turtlebot exercise
apt-get -y --quiet --no-install-recommends install \
ros-$ROS_DISTRO-turtlebot3-description
#---------------------------------------------------------------------
# websocket server dependency
#---------------------------------------------------------------------
RUN apt-get update && apt-get install -y python2.7 python-pip
RUN pip install websocket_server posix-ipc
RUN apt-get install -y python3.8 python3-pip
RUN python3.8 -m pip install websockets asyncio
# Setup environment variables
RUN echo 'export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/Firmware' >> ~/.bashrc
RUN echo 'export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/Firmware/Tools/sitl_gazebo' >> ~/.bashrc
RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
# Other exercises specific dependcies similar to PX4 like MoveIt may go here!
# ...
# ...
# Constant installations
# Dependencies required for all the exercises may go here!
# In case of a new dependency
# For installation with apt-get add it to the list of apt-get dependencies
# For installation from a git repository add it to the end
# Put the other commands in bashrc file
RUN echo 'source /opt/ros/melodic/setup.bash' >> ~/.bashrc
RUN echo 'source /usr/share/gazebo-9/setup.sh' >> ~/.bashrc
# apt-get install dependencies
# Nodejs, x11vnc, xterm, xdummy, python2, pip2, python3, pip3
RUN apt-get update && apt-get --no-install-recommends install -y \
x11vnc \
xterm \
xserver-xorg-video-dummy \
x11-apps \
python2.7 \
python-pip \
python3.8 \
python3-pip \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
RUN wget https://xpra.org/xorg.conf \
&& rm -rf /tmp/*
# ROS dependencies for exercises
# ros-melodic-kobuki-msgs: Vaccuum Cleaner
# xmlstarlet: Drone Cat Mouse
# ros-$ROS_DISTRO-turtlebot3-description: Follow Turtlebot
RUN apt-get -y --quiet --no-install-recommends install \
ros-melodic-kobuki-msgs \
xmlstarlet \
ros-$ROS_DISTRO-turtlebot3-description \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
# python dependencies
RUN pip install websocket_server posix-ipc
RUN python3.8 -m pip install websockets asyncio
RUN pip3 install django