forked from diegoferigo/development-iit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
253 lines (238 loc) · 8.25 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
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
ARG from=diegoferigo/devenv:latest
FROM ${from}
# Utilities
RUN apt-get update &&\
apt-get install -y --no-install-recommends \
sudo \
software-properties-common \
apt-transport-https \
apt-utils \
wget \
nano \
dbus-x11 \
tree \
bash-completion \
libgnome-keyring0 \
gnupg2 \
colordiff \
octave \
trash-cli \
xterm \
curl \
unzip \
mesa-utils \
&&\
rm -rf /var/lib/apt/lists/*
# Setup locales and timezone
ENV TZ=Europe/Rome
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update &&\
apt-get install -y --no-install-recommends locales locales-all tzdata &&\
rm -rf /var/lib/apt/lists/* &&\
echo "${TZ}" | tee /etc/timezone &&\
dpkg-reconfigure --frontend noninteractive tzdata
# Updated clang ppa
ARG clang_version=10
ENV CLANG_VER=${clang_version}
# Build and development tools
RUN wget -nv -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - &&\
apt-add-repository -y "deb http://apt.llvm.org/`lsb_release -cs`/ llvm-toolchain-`lsb_release -cs`-${CLANG_VER} main" &&\
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ `lsb_release -cs` main" &&\
apt-get install -y kitware-archive-keyring &&\
apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA &&\
add-apt-repository ppa:ubuntu-toolchain-r/test &&\
apt-get update &&\
apt-get install -y --no-install-recommends \
build-essential \
git \
cmake \
cmake-curses-gui \
ninja-build \
gcc-9 \
g++-9 \
llvm-${CLANG_VER} \
clang-${CLANG_VER} \
lldb-${CLANG_VER} \
libclang-${CLANG_VER}-dev \
clang-format-${CLANG_VER} \
clang-tidy-${CLANG_VER} \
libclang-common-${CLANG_VER}-dev \
llvm-${CLANG_VER}-dev \
libllvm${CLANG_VER} \
gdb \
valgrind \
valkyrie \
kcachegrind \
ccache \
cppcheck \
doxygen \
graphviz \
lsof \
net-tools \
iputils-ping \
strace \
&&\
rm -rf /var/lib/apt/lists/*
# Install and setup python tools
RUN apt-get update &&\
apt-get install -y --no-install-recommends \
python3-pip \
python3-setuptools \
python3-dev \
python3-wheel \
python3-pygments \
&&\
rm -rf /var/lib/apt/lists/* &&\
pip3 install \
python-language-server[all] \
colour-valgrind \
mkdocs \
mkdocs-material
# Setup HW Acceleration for Intel graphic cards
RUN apt-get update &&\
apt-get install -y \
libgl1-mesa-glx \
libgl1-mesa-dri &&\
rm -rf /var/lib/apt/lists/*
# ====================
# Packages with no ppa
# ====================
# QtCreator
ARG QTCREATOR_VERSION=4.12.0
COPY QtCreatorSetup.js /tmp/QtCreatorSetup.js
COPY qtaccount.ini /root/.local/share/Qt/qtaccount.ini
RUN cd /tmp &&\
wget http://download.qt.io/official_releases/qtcreator/${QTCREATOR_VERSION%.*}/${QTCREATOR_VERSION}/qt-creator-opensource-linux-x86_64-${QTCREATOR_VERSION}.run &&\
chmod +x qt-creator-opensource-linux-x86_64-${QTCREATOR_VERSION}.run &&\
./qt-creator-opensource-linux-x86_64-${QTCREATOR_VERSION}.run --platform minimal --script QtCreatorSetup.js &&\
rm /tmp/qt-creator-opensource-linux-x86_64-${QTCREATOR_VERSION}.run /tmp/QtCreatorSetup.js &&\
ln -s /opt/qtcreator/bin/qtcreator.sh /usr/bin/qtcreator &&\
rm /root/.local/share/Qt/qtaccount.ini
# Gitkraken
RUN apt-get update &&\
apt-get install -y --no-install-recommends \
gconf2 \
libgtk2.0-0 \
gvfs-bin \
libnotify4 \
libnss3 \
libxtst6 \
libxkbfile1 \
xdg-utils \
&&\
rm -rf /var/lib/apt/lists/* &&\
cd /tmp &&\
wget https://release.gitkraken.com/linux/gitkraken-amd64.deb &&\
apt install /tmp/gitkraken-amd64.deb &&\
rm /tmp/gitkraken-amd64.deb
# rr
# RUN apt-get update &&\
# apt-get install -y --no-install-recommends \
# ccache \
# cmake \
# make \
# g++-multilib \
# gdb \
# pkg-config \
# python3-pexpect \
# manpages-dev \
# git \
# ninja-build \
# capnproto \
# libcapnp-dev &&\
# rm -rf /var/lib/apt/lists/* &&\
# cd /tmp &&\
# git clone --depth 1 https://github.com/mozilla/rr.git &&\
# cd rr && mkdir build && cd build &&\
# cmake -G Ninja .. &&\
# cmake --build . &&\
# cmake --build . --target install &&\
# rm -r /tmp/rr
# SWIG with Matlab / Octave support
# ... waiting its upstream merge
RUN apt-get update &&\
apt-get install -y --no-install-recommends \
autotools-dev \
automake \
bison \
libpcre3-dev &&\
rm -rf /var/lib/apt/lists/* &&\
cd /tmp/ &&\
git clone --depth 1 -b matlab https://github.com/robotology-dependencies/swig.git &&\
cd swig &&\
sh autogen.sh &&\
CC=clang-${CLANG_VER} CXX=clang++-${CLANG_VER} ./configure &&\
make -j2 &&\
make install &&\
rm -r /tmp/swig
# IWYU
RUN apt-get update &&\
apt-get install -y --no-install-recommends \
libncurses5-dev \
libz-dev \
&&\
rm -rf /var/lib/apt/lists/* &&\
cd /tmp &&\
git clone https://github.com/include-what-you-use/include-what-you-use.git &&\
cd include-what-you-use &&\
git checkout clang_${CLANG_VER} &&\
mkdir build && cd build &&\
cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release &&\
cmake --build . --target install &&\
rm -r /tmp/include-what-you-use
# Extra tools
ARG EXA_VERSION=0.9.0
ARG BAT_VERSION=0.15.1
ARG STARSHIP_VERSION=0.41.3
RUN \
mkdir /opt/extra && cd /opt/extra &&\
# https://github.com/ogham/exa
apt-get update && apt-get install libhttp-parser2.7.1 && rm -rf /var/lib/apt/lists/* &&\
wget https://github.com/ogham/exa/releases/download/v${EXA_VERSION}/exa-linux-x86_64-${EXA_VERSION}.zip &&\
unzip exa-linux-x86_64-${EXA_VERSION}.zip &&\
mv exa-linux-x86_64 /usr/local/bin/exa &&\
# https://github.com/junegunn/fzf
git clone --depth 1 https://github.com/junegunn/fzf &&\
yes | ./fzf/install --no-update-rc &&\
mv ~/.fzf.bash /opt/extra/fzf.bash &&\
echo "[ -f /opt/extra/fzf.bash ] && source /opt/extra/fzf.bash" >> /etc/bash.bashrc &&\
# https://github.com/sharkdp/bat
wget https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/bat_${BAT_VERSION}_amd64.deb &&\
dpkg -i bat_*_amd64.deb && rm bat_*_amd64.deb &&\
# https://github.com/jonas/tig
git clone --depth 1 https://github.com/jonas/tig &&\
cd tig && make install prefix=/usr/local && cd .. && rm -r tig &&\
# https://github.com/nvbn/thefuck
pip3 install thefuck &&\
echo '[ -x /usr/local/bin/thefuck ] && eval $(thefuck --alias)' >> /etc/bash.bashrc &&\
# Enable bash completion
LINESTART=$(grep -nr "if ! shopt -oq posix; then" /etc/bash.bashrc | cut -d : -f1) &&\
LINEEND=$((LINESTART+6)) &&\
sed -i "$LINESTART,$LINEEND s/#*//" /etc/bash.bashrc &&\
# https://github.com/starship/starship
apt-get update &&\
apt-get install -y --no-install-recommends fonts-powerline &&\
rm -rf /var/lib/apt/lists/* &&\
wget https://github.com/starship/starship/releases/download/v${STARSHIP_VERSION}/starship-x86_64-unknown-linux-gnu.tar.gz &&\
tar -xvf starship-x86_64-unknown-linux-gnu.tar.gz &&\
rm -r starship-x86_64-unknown-linux-gnu.tar.gz &&\
echo '[ -x /opt/extra/starship ] && eval "$(/opt/extra/starship init bash)"' >> /etc/bash.bashrc &&\
# https://github.com/rupa/z
# Always keep this entry as last one
wget https://raw.githubusercontent.com/rupa/z/master/z.sh &&\
echo "[ -f /opt/extra/z.sh ] && . /opt/extra/z.sh" >> /etc/bash.bashrc
# Some QT-Apps/Gazebo don't show controls without this
ENV QT_X11_NO_MITSHM=1
# Setup an additional entrypoint script
COPY setup.sh /usr/sbin/setup_tools.sh
COPY entrypoint.sh /usr/sbin/entrypoint_tools.sh
RUN chmod 755 /usr/sbin/setup_tools.sh
RUN chmod 755 /usr/sbin/entrypoint_tools.sh
ENTRYPOINT ["/usr/sbin/entrypoint_tools.sh"]
CMD ["bash"]