CI: Add GHA merge workflow that runs a SonarCloud scan
[it/dev.git] / bldr-imgs / bldr-ubuntu18-c-go / Dockerfile
1 # O-RAN-SC
2 #
3 # Copyright (C) 2019-2020 AT&T Intellectual Property and Nokia
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 # Builder image with superset of CI tools for RIC components
18
19 FROM nexus3.o-ran-sc.org:10001/ubuntu:18.04
20
21 RUN apt-get update && apt-get install -y \
22     alien \
23     autoconf \
24     autoconf-archive \
25     automake \
26     autotools-dev \
27     build-essential \
28     cmake \
29     g++  \
30     gcc \
31     git \
32     ksh \
33     libbz2-dev \
34     libicu-dev \
35     libsctp-dev \
36     libtool \
37     lksctp-tools \
38     make \
39     python-dev \
40     pkg-config \
41     software-properties-common \
42     sudo \
43     wget \
44     zlib1g \
45     zlib1g-dev \
46     zlibc \
47     zip
48
49 WORKDIR /tmp
50
51 # Install go versions in /opt
52 RUN mkdir -p /opt/go
53
54 ARG g12="1.12.17"
55 RUN wget -nv https://dl.google.com/go/go${g12}.linux-amd64.tar.gz \
56     && tar -xf go${g12}.linux-amd64.tar.gz \
57     && mv go /opt/go/1.12 \
58     && rm -f go*.gz
59
60 ARG g13="1.13.12"
61 RUN wget -nv https://dl.google.com/go/go${g13}.linux-amd64.tar.gz \
62     && tar -xf go${g13}.linux-amd64.tar.gz \
63     && mv go /opt/go/1.13 \
64     && rm -f go*.gz
65
66 ARG g14="1.14.4"
67 RUN wget -nv https://dl.google.com/go/go${g14}.linux-amd64.tar.gz \
68     && tar -xf go${g14}.linux-amd64.tar.gz \
69     && mv go /opt/go/1.14 \
70     && rm -f go*.gz
71
72 ENV GOPATH=/root/go
73 # Default path has go version 1.12.x
74 # Use /opt/go/1.13/bin for version 1.13.x
75 # Use /opt/go/1.14/bin for version 1.14.x
76 ENV PATH=$PATH:/opt/go/1.12/bin:$GOPATH/bin
77
78 # This installs go-acc to GOPATH
79 RUN go version \
80     && go get -v github.com/ory/go-acc \
81     && go-acc --help
82
83 # install a recent version of cmake, ubuntu repo version is old
84 ARG cv="3.14.5"
85 RUN wget -nv https://github.com/Kitware/CMake/releases/download/v${cv}/cmake-${cv}-Linux-x86_64.sh \
86     && chmod +x cmake-${cv}-Linux-x86_64.sh \
87     && ./cmake-${cv}-Linux-x86_64.sh --prefix=/usr/local --skip-license \
88     && rm -f cmake*.sh
89
90 # sonar-scanner is not available in ubuntu repo
91 ARG sv="4.2.0.1873"
92 RUN wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${sv}-linux.zip \
93     && unzip sonar-scanner-cli-${sv}-linux.zip \
94     && mv sonar-scanner-${sv}-linux /usr/local/sonar-scanner \
95     && rm -f sonar*.zip
96
97 # golangci-lint is not available in ubuntu repo
98 RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.23.6 \
99     && rm -f install.sh
100
101 # install a recent version of boost, ubuntu repo version is old
102 ARG bv="1_69_0"
103 RUN wget -nv https://dl.bintray.com/boostorg/release/1.69.0/source/boost_${bv}.zip \
104     && unzip -q boost_${bv}.zip \
105     && cd boost_${bv} \
106     && ./bootstrap.sh --prefix=/usr/ \
107     && ./b2 \
108     && ./b2 install \
109     && cd ../ \
110     && rm -rf boost*.zip boost_${bv}