-
Notifications
You must be signed in to change notification settings - Fork 60
/
cpu.Dockerfile
280 lines (231 loc) · 8.34 KB
/
cpu.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
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
FROM ubuntu:18.04
# ------ powered by Ge Yao, [email protected] ------
LABEL maintainer="[email protected]"
# ------ USER ROOT HAS BEEN ACTIVATED ------
# use root for dependency installation:
USER root
# ------ PART 0: set environment variables ------
# set up environment:
ENV DEBIAN_FRONTEND noninteractive
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV HOME=/root SHELL=/bin/bash
# ------ PART 1: set up CN sources ------
# Ubuntu:
COPY ${PWD}/image/etc/apt/sources.list /etc/apt/sources.list
RUN rm -f /etc/apt/sources.list.d/*
# Python:
COPY ${PWD}/image/etc/pip.conf /root/.pip/pip.conf
# ------ PART 2: set up apt-fast -- NEED PROXY DUE TO UNSTABLE CN CONNECTION ------
# install:
RUN apt-get update -q --fix-missing && \
apt-get install -y --no-install-recommends --allow-unauthenticated \
# PPA utilities:
software-properties-common \
# certificates management:
dirmngr gnupg2 \
# download utilities:
axel aria2 && \
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-keys 1EE2FF37CA8DA16B && \
add-apt-repository ppa:apt-fast/stable && \
apt-get update -q --fix-missing && \
apt-get install -y --no-install-recommends --allow-unauthenticated apt-fast && \
rm -rf /var/lib/apt/lists/*
# CN config:
COPY ${PWD}/image/etc/apt-fast.conf /etc/apt-fast.conf
# ------ PART 3: add external repositories ------
# ROS:
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
COPY ${PWD}/image/etc/apt/sources.list.d/ /etc/apt/sources.list.d/
# libsparse:
RUN add-apt-repository -r ppa:bzindovic/suitesparse-bugfix-1319687
# ------ PART 4: install packages ------
RUN apt-fast update --fix-missing && \
apt-fast install -y --no-install-recommends --allow-unauthenticated \
# package utils:
sudo dpkg pkg-config apt-utils \
# security:
openssh-server pwgen ca-certificates \
# network utils:
curl wget iputils-ping net-tools \
# command line:
vim grep sed patch \
# io:
pv zip unzip bzip2 \
# version control:
git mercurial subversion \
# daemon & services:
supervisor nginx \
# dev. tools:
terminator \
firefox \
# potential image & rich text IO:
libsdl1.2-dev libsdl-net1.2-dev libsdl-image1.2-dev \
lxde \
gnome-themes-standard \
xvfb dbus-x11 x11-utils libxext6 libsm6 x11vnc \
gtk2-engines-pixbuf gtk2-engines-murrine pinta ttf-ubuntu-font-family \
mesa-utils libgl1-mesa-dri libxrender1 \
gnuplot \
texlive-latex-extra \
#
# general development:
#
# a. c++:
gcc g++ \
make cmake build-essential autoconf automake libtool \
libglib2.0-dev libboost-dev libboost-all-dev \
libomp-dev libtbb-dev \
libgoogle-glog-dev \
# b. Python 2:
python-pip python-dev python-tk \
# c. lua:
lua5.3 liblua5.3-dev libluabind-dev \
#
# numerical optimization:
#
coinor-libcoinutils-dev \
coinor-libcbc-dev \
libeigen3-dev \
gfortran \
libopenblas-dev liblapack-dev \
libdw-dev libatlas-base-dev libsuitesparse-dev \
libcholmod3 libcxsparse3 \
libmetis-dev \
#
# 3D graphics:
#
freeglut3-dev \
libqt4-dev libqt4-opengl-dev \
qt5-default qt5-qmake \
qtdeclarative5-dev libqglviewer-dev-qt5 \
#
# ROS melodic:
#
ros-melodic-desktop-full \
ros-melodic-ecl-threads \
ros-melodic-rosbridge-server \
ros-melodic-tf2 ros-melodic-tf2-ros ros-melodic-tf2-sensor-msgs \
ros-melodic-teleop-twist-keyboard \
ros-melodic-rviz-visual-tools \
ros-melodic-plotjuggler \
python-catkin-tools python-rosdep python-rosinstall python-rosinstall-generator python-wstool \
ninja-build \
# imu:
ros-melodic-imu-complementary-filter ros-melodic-imu-filter-madgwick ros-melodic-rviz-imu-plugin \
# lidar:
ros-melodic-laser-pipeline \
ros-melodic-perception-pcl && \
apt-fast autoclean && \
apt-fast autoremove && \
rm -rf /var/lib/apt/lists/*
# ordered startup fix for supervisord:
RUN pip install ordered-startup-supervisord
# ------ PART 5: set up ROS environments ------
# initialize rosdep
#
# NOTE:
# be careful about DNS resolution problem caused by https://raw.githubusercontent.com
# get the latest IP address of the site from Baidu and Google search engine
#
RUN rosdep fix-permissions && \
rosdep init && \
rosdep update
# activate ros environment:
RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
# for remote debugging:
EXPOSE 11311
# ------ PART 6: set up VNC servers ------
COPY image /
WORKDIR /usr/lib/
RUN git clone https://github.com/novnc/noVNC.git -o noVNC
WORKDIR /usr/lib/noVNC/utils
RUN git clone https://github.com/novnc/websockify.git -o websockify
WORKDIR /usr/lib/webportal
RUN pip install --upgrade pip && pip install -r requirements.txt
EXPOSE 80 5901 9001
# ------ PART 7: library dependencies ------
# load installers:
COPY ${PWD}/installers /tmp/installers
WORKDIR /tmp/installers
# install Google Protobuf -- 3.14.x:
RUN git clone https://github.com/google/protobuf.git -b 3.14.x -o protobuf && cd protobuf && \
# sync:
git submodule update --init --recursive && \
# config:
./autogen.sh && ./configure && \
# build:
make -j8 && \
# install:
make install
# install Aceinna GNSS/IMU sim IMU-GNSS-Odo simulation with customized error modes:
RUN git clone https://github.com/AlexGeControl/GNSS-INS-SIM-Extended.git && cd GNSS-INS-SIM-Extended && \
# install:
python setup.py install
# install GeographicLib -- 1.50.1
RUN wget https://nchc.dl.sourceforge.net/project/geographiclib/distrib/GeographicLib-1.50.1.zip && \
unzip -q GeographicLib-1.50.1.zip && cd GeographicLib-1.50.1 && \
mkdir build && cd build && \
# config:
cmake .. && \
# build:
make -j8 && \
# install:
make install
# install sophus -- commit id 49a7e1286910019f74fb4f0bb3e213c909f8e1b7:
RUN git clone https://github.com/strasdat/Sophus.git -o Sophus && cd Sophus && \
# align version:
git fetch --all --tags && git checkout 49a7e1286910019f74fb4f0bb3e213c909f8e1b7 && \
# start to build
mkdir build && cd build && \
# config:
cmake .. && \
# build:
make -j8 && \
# install:
make install
# install ceres -- commit id c2fab6502e5a341ff644c2bb2c5171ebd882b2d6:
RUN git clone https://github.com/ceres-solver/ceres-solver.git -o ceres-solver && cd ceres-solver && \
# align version:
git fetch --all --tags && git checkout c2fab6502e5a341ff644c2bb2c5171ebd882b2d6 && cd /tmp/installers/ && \
# config:
mkdir ceres-bin && cd ceres-bin && cmake ../ceres-solver && \
# build:
make -j8 && \
# install:
make install
# install g2o -- release 20200410_git:
RUN git clone https://github.com/RainerKuemmerle/g2o.git -o g2o && cd g2o && \
# align version:
git fetch --all --tags && git checkout tags/20200410_git -b release-20200410 && \
# start to build:
mkdir build && cd build && \
# config:
cmake .. && \
# build:
make -j8 && \
# install:
make install
# install gtsam -- 4.0.3:
RUN git clone https://github.com/borglab/gtsam.git -o gtsam && cd gtsam && \
# align version:
git fetch --all --tags && git checkout tags/4.0.3 -b release-4.0.3 && \
# start to build:
mkdir build && cd build && \
# config:
cmake .. && \
# build:
make -j8 && \
# install:
make install
# install tini:
RUN chmod u+x ./download-tini.sh && ./download-tini.sh && dpkg -i tini.deb && \
apt-get clean
RUN rm -rf /tmp/installers
# ------ PART 8: Python dependencies ------
COPY environment /workspace
WORKDIR /workspace
RUN pip install -r requirements.txt
# ------------------ DONE -----------------------
# enable dependency lib linking:
ENV LD_LIBRARY_PATH=/usr/local/lib
ENTRYPOINT ["/startup.sh"]