-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpine-gnu-sonarqube
58 lines (47 loc) · 3.13 KB
/
alpine-gnu-sonarqube
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
# vim: filetype=dockerfile:
FROM alpine:edge
# Install system-wide prerequisites
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && cat /etc/apk/repositories
RUN apk update && apk add libtool autoconf automake gfortran gcc g++ make boost-dev ccache openjdk8 wget bash m4 file git cmake perl grep zlib-dev libexecinfo-dev doxygen ninja graphviz libdwarf-dev libelf-dev binutils-dev patch unzip curl
# Add glibc for sonarqube wrapper
ADD https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk /
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
RUN apk add glibc-2.25-r0.apk
# Install sonarqube scanner and wrapper
ADD https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip /
ADD https://sonarqube.com/static/cpp/build-wrapper-linux-x86.zip /
RUN mkdir /sonarqube && unzip /sonar-scanner-cli-3.2.0.1227-linux.zip -d /sonarqube && unzip /build-wrapper-linux-x86.zip -d /sonarqube
ENV PATH=${PATH}:/sonarqube/build-wrapper-linux-x86:/sonarqube/sonar-scanner-3.2.0.1227-linux/bin
RUN rm -rf sonar-scanner-cli-3.2.0.1227-linux.zip build-wrapper-linux-x86.zip
RUN sonar-scanner -h
# Install OpenMPI with gnu
ADD http://download.open-mpi.org/release/open-mpi/v2.1/openmpi-2.1.5.tar.gz /openmpi/
RUN cd /openmpi/ && tar xzf openmpi-2.1.5.tar.gz
# Patch OpenMPI 2.1.5, see https://github.com/open-mpi/ompi/issues/1838#issuecomment-230201439
ADD 111.patch /openmpi/openmpi-2.1.5/opal/mca/pmix/pmix112/pmix
RUN cd /openmpi/openmpi-2.1.5/opal/mca/pmix/pmix112/pmix && patch -p1 < 111.patch
RUN cd /openmpi/openmpi-2.1.5 && ./configure --enable-shared --enable-static --prefix=/opt/openmpi/gnu && make -sj$(grep -c processor /proc/cpuinfo) install
RUN rm -rf /openmpi
ENV PATH /opt/openmpi/gnu/bin:$PATH
ENV OMPI_MCA_plm isolated
# Create symbolic link to /lib/cpp for the charm++ build, see
# https://lists.cs.illinois.edu/lists/arc/charm/2016-05/msg00013.html
RUN ln -s /usr/bin/cpp /lib/cpp
# Configure user
RUN addgroup quinoa
RUN adduser -S quinoa quinoa
RUN chown -R quinoa:quinoa /home/quinoa
USER quinoa
WORKDIR /home/quinoa
# Clone quinoa
RUN git clone --recurse-submodules http://github.com/quinoacomputing/quinoa.git
# Pull in docker build arg: COMMIT
ARG COMMIT
# Checkout specific commit
RUN cd quinoa && git checkout $COMMIT && git log -1 HEAD
# Update submodules
RUN cd quinoa && git submodule init && git submodule update --recursive && cd external && git submodule init && git submodule update --recursive && cd .. && git submodule status --recursive
# Build TPLs with gnu as shared libs
RUN cd quinoa && mkdir -p external/build/gnu && cd external/build/gnu && export PATH=/opt/openmpi/gnu/bin:$PATH && cmake -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DCMAKE_BUILD_TYPE=Release -DENABLE_OMEGA_H=true -DENABLE_DOXYGEN=false -DENABLE_MCSS=false -DCHARM_EXTRA_ARGS="--enable-error-checking" -DCMAKE_INSTALL_PREFIX=/home/quinoa/external/gnu -DCXXFLAGS="-w -fpermissive" ../.. && make -sj$(grep -c processor /proc/cpuinfo)
# Remove quinoa (keep only TPLs)
RUN rm -rf /home/quinoa/quinoa