-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile.cicd-devel
157 lines (147 loc) · 5.5 KB
/
Dockerfile.cicd-devel
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
ARG from=ubuntu:bionic
FROM ${from}
# CI preset: CMAKE_BUILD_TYPE=Debug BUILD_SHARED_LIBS=ON
# CD preset: CMAKE_BUILD_TYPE=Release BUILD_SHARED_LIBS=OFF
ARG CMAKE_BUILD_TYPE=Release
ARG BUILD_SHARED_LIBS=OFF
# Install tools and toolchain
RUN apt-get update &&\
apt-get install -y --no-install-recommends \
wget \
software-properties-common \
apt-transport-https \
apt-utils \
gnupg2 \
nano \
rename \
source-highlight \
&&\
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" &&\
add-apt-repository ppa:deadsnakes/ppa &&\
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`-10 main" &&\
apt-get update &&\
apt-get install -y --no-install-recommends \
git \
g++ \
g++-8 \
clang \
clang-9 \
clang-10 \
make \
cmake \
cmake-curses-gui \
ninja-build \
valgrind \
libgflags-dev \
python3-pip \
python3-wheel \
python3.6 \
python3.8 \
python3.6-dev \
python3.8-dev \
libpython3.6-dev \
libpython3.8-dev \
virtualenv \
&&\
rm -rf /var/lib/apt/lists/*
# Update git (required by actions/checkout)
RUN add-apt-repository ppa:git-core/ppa &&\
apt-get update &&\
apt-get install -y --no-install-recommends git &&\
rm -rf /var/lib/apt/lists/*
# Install SWIG from sources
ARG SWIG_REL="rel-4.0.1"
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 ${SWIG_REL} https://github.com/swig/swig.git &&\
cd swig &&\
sh autogen.sh &&\
./configure &&\
make -j2 &&\
make install &&\
rm -r /tmp/swig
# Install ignition robotics
ARG IGNITION_DEFAULT_CHANNEL="prerelease"
RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-${IGNITION_DEFAULT_CHANNEL} `lsb_release -cs` main" > \
/etc/apt/sources.list.d/gazebo-${IGNITION_DEFAULT_CHANNEL}.list &&\
wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add - &&\
apt-get update &&\
apt-get install -y --no-install-recommends \
cmake freeglut3-dev libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev \
libdart6-collision-ode-dev libdart6-dev libdart6-utils-urdf-dev \
libfreeimage-dev libgflags-dev libglew-dev libgts-dev libogre-1.9-dev libogre-2.1-dev \
libprotobuf-dev libprotobuf-dev libprotoc-dev \
libqt5core5a libswscale-dev libtinyxml2-dev libtinyxml-dev pkg-config \
protobuf-compiler python qml-module-qt-labs-folderlistmodel \
qml-module-qt-labs-settings qml-module-qtquick2 qml-module-qtquick-controls \
qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-layouts \
qml-module-qtqml-models2 qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev \
ruby ruby-ronn uuid-dev libzip-dev libjsoncpp-dev libcurl4-openssl-dev libyaml-dev \
libzmq3-dev libsqlite3-dev libwebsockets-dev \
#swig \#
ruby-dev \
&&\
rm -rf /var/lib/apt/lists/*
RUN pip3 install setuptools &&\
pip3 install vcstool colcon-common-extensions &&\
rm -r $HOME/.cache/pip
ADD tags.yaml /tags.yaml
RUN mkdir -p /workspace/src &&\
cd /workspace/src &&\
vcs import < /tags.yaml &&\
cd /workspace &&\
colcon graph &&\
CC=gcc-8 CXX=g++-8 \
colcon build \
--packages-end ignition-sensors3 \
--cmake-args -GNinja \
-DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release \
--merge-install \
&&\
CC=clang-9 CXX=clang++-9 \
colcon build \
--packages-start ignition-gazebo3 \
--cmake-args -GNinja \
-DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} \
--merge-install \
&&\
rm -r /workspace/build &&\
rm -r /workspace/src/* &&\
echo "source /workspace/install/setup.bash" >> /etc/bash.bashrc
# Install idyntree
RUN apt-get update &&\
apt-get install -y --no-install-recommends python3-numpy libxml2-dev coinor-libipopt-dev libeigen3-dev &&\
rm -rf /var/lib/apt/lists/* &&\
git clone --depth 1 -b feature/numpy-and-ik https://github.com/diegoferigo/idyntree /tmp/idyntree &&\
mkdir -p /tmp/idyntree/build && cd /tmp/idyntree/build &&\
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DIDYNTREE_SHARED_LIBRARY:BOOL=${BUILD_SHARED_LIBS} \
-DIDYNTREE_USES_PYTHON=True \
-DPython_ADDITIONAL_VERSIONS=3.6 \
-DIDYNTREE_USES_PYTHON_VERSION=3.6 \
-DPYTHON_NUMPY_INCLUDE_DIR:PATH=/usr/lib/python3/dist-packages/numpy/core/include \
-DIDYNTREE_USES_IPOPT:BOOL=ON \
&&\
cmake --build . --target install &&\
rm -r /tmp/idyntree
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
ENV PYTHONPATH=${PYTHONPATH}:/usr/local/lib/python3/dist-packages
# Prepare virtualenv variables
ENV VIRTUAL_ENV=/venv
ENV PATH=${VIRTUAL_ENV}/bin:${PATH}
COPY entrypoint.sh /entrypoint.sh
COPY setup_virtualenv.sh /setup_virtualenv.sh
RUN chmod 755 /entrypoint.sh
RUN chmod 755 /setup_virtualenv.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]