forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
176 lines (162 loc) · 4.49 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
FROM debian:stretch
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
ENV LC_ALL C.UTF-8
RUN apt-get update \
&& apt-get -y install \
curl \
build-essential \
autotools-dev \
automake \
cmake \
pkg-config \
ruby \
ruby-dev \
python-all \
python-pip \
python3-all \
libpython3-dev \
dh-exec \
dh-lua \
liblua5.3-dev \
tclcl-dev \
libaugeas-dev \
libbotan1.10-dev \
libgpgme-dev \
libyajl-dev \
git \
libgit2-dev \
libgtest-dev \
libboost-all-dev \
libssl-dev \
libdbus-1-dev \
libpcre3-dev \
libpcre++-dev \
libglib2.0-dev \
libxerces-c-dev \
qtbase5-dev \
qtdeclarative5-dev \
libmarkdown2-dev \
discount \
swig3.0 \
libuv1-dev \
libev-dev \
libzmq3-dev \
checkinstall \
openjdk-8-jdk \
maven \
gobject-introspection \
libgirepository1.0-dev \
systemd \
libsystemd-dev \
mingw-w64 \
wine \
llvm \
icheck \
devscripts \
lintian \
diffutils \
patch \
patchutils \
git-buildpackage \
reprepro \
doxygen \
graphviz \
gawk \
lcov \
valgrind \
ed \
dnsutils \
virtualenv \
bison \
uuid-dev \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
# Google Test
ENV GTEST_ROOT=/opt/gtest
ARG GTEST_VER=release-1.8.1
RUN mkdir -p ${GTEST_ROOT} \
&& cd /tmp \
&& curl -o gtest.tar.gz \
-L https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz \
&& tar -zxvf gtest.tar.gz --strip-components=1 -C ${GTEST_ROOT} \
&& rm gtest.tar.gz
# Handle Java
RUN echo 'export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")'>> /etc/bash.bashrc
RUN echo '\
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/\n\
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/\n' > /etc/ld.so.conf.d/jdk.conf
# ANTLR
ARG ANTLR_VERSION=4.7.2
RUN cd /usr/local/lib \
&& curl -o antlr.jar -L https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar \
&& cd /usr/local/bin \
&& printf '\
#!/usr/bin/env sh\n\
CLASSPATH=.:/usr/local/lib/antlr.jar exec java -jar /usr/local/lib/antlr.jar "$@"' > antlr4 \
&& printf '\
#!/usr/bin/env sh\n\
java -classpath .:/usr/local/lib/antlr.jar org.antlr.v4.gui.TestRig "$@"' > grun \
&& chmod a+x antlr4 grun
# ANTLR C++ runtime
RUN cd /tmp \
&& git clone --branch ${ANTLR_VERSION} --depth 1 https://github.com/antlr/antlr4.git \
&& cd antlr4/runtime/Cpp \
&& mkdir build \
&& cd build \
&& cmake -GNinja -DANTLR_JAR_LOCATION=/usr/local/lib/antlr.jar -DCMAKE_BUILD_TYPE=Release .. \
&& ninja \
&& ninja install \
&& cd /tmp \
&& rm -r antlr4
# yaml-cpp
RUN cd /tmp \
&& git clone --branch yaml-cpp-0.6.2 --depth 1 https://github.com/jbeder/yaml-cpp.git \
&& cd yaml-cpp \
&& mkdir build \
&& cd build \
&& cmake -GNinja -DYAML_CPP_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON .. \
&& ninja \
&& ninja install \
&& cd ../.. \
&& rm -r yaml-cpp
# Update cache for shared libraries
RUN ldconfig
# Create User:Group
# The id is important as jenkins docker agents use the same id that is running
# on the slaves to execute containers
ARG JENKINS_GROUPID
RUN groupadd \
-g ${JENKINS_GROUPID} \
-f \
jenkins
ARG JENKINS_USERID
RUN useradd \
--create-home \
--uid ${JENKINS_USERID} \
--gid ${JENKINS_GROUPID} \
--shell "/bin/bash" \
jenkins
USER ${JENKINS_USERID}
RUN git config --global user.email 'Jenkins <[email protected]>' \
&& git config --global user.name 'Jenkins'
# shfmt
ENV SHFMT_PATH=/home/jenkins/bin
ENV SHFMT_VERSION=v2.6.3
ENV PATH="${SHFMT_PATH}:${PATH}"
RUN mkdir -p "${SHFMT_PATH}" \
&& cd "${SHFMT_PATH}" \
&& curl -L "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64" -o shfmt \
&& chmod a+x shfmt
# cmake-format
RUN pip install cmake-format[yaml]==0.5.4
# Coveralls
ENV COVERALLS_VIRTUALENV_PATH=/home/jenkins/coveralls
RUN virtualenv "${COVERALLS_VIRTUALENV_PATH}" \
&& cd "${COVERALLS_VIRTUALENV_PATH}" \
&& . bin/activate \
&& pip install "urllib3==1.22" \
&& pip install pyyaml \
&& pip install cpp-coveralls \
&& deactivate
ENV PATH="${PATH}:${COVERALLS_VIRTUALENV_PATH}/bin"