Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 1 | # O-RAN-SC |
| 2 | # |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 3 | # Copyright (C) 2019-2020 AT&T Intellectual Property and Nokia |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 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 | |
Lott, Christopher (cl778h) | d63fe20 | 2019-06-17 09:01:48 -0400 | [diff] [blame] | 17 | # Builder image with superset of CI tools for RIC components |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 18 | |
Lott, Christopher (cl778h) | a92406b | 2019-06-28 11:18:44 -0400 | [diff] [blame] | 19 | FROM nexus3.o-ran-sc.org:10001/ubuntu:18.04 |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 20 | |
| 21 | RUN apt-get update && apt-get install -y \ |
Lott, Christopher (cl778h) | b09f682 | 2019-06-20 09:14:28 -0400 | [diff] [blame] | 22 | autoconf \ |
| 23 | autoconf-archive \ |
| 24 | automake \ |
| 25 | autotools-dev \ |
| 26 | build-essential \ |
| 27 | g++ \ |
| 28 | gcc \ |
| 29 | git \ |
| 30 | libbz2-dev \ |
| 31 | libicu-dev \ |
| 32 | libsctp-dev \ |
| 33 | libtool \ |
| 34 | lksctp-tools \ |
| 35 | make \ |
| 36 | python-dev \ |
| 37 | pkg-config \ |
| 38 | software-properties-common \ |
Lott, Christopher (cl778h) | 4bc973c | 2020-03-17 09:15:03 -0400 | [diff] [blame] | 39 | sudo \ |
Lott, Christopher (cl778h) | b09f682 | 2019-06-20 09:14:28 -0400 | [diff] [blame] | 40 | wget \ |
| 41 | zlib1g \ |
| 42 | zlib1g-dev \ |
| 43 | zlibc \ |
| 44 | zip |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 45 | |
| 46 | WORKDIR /tmp |
| 47 | |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 48 | # Install go versions in /opt |
| 49 | RUN mkdir -p /opt/go |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 50 | |
Lott, Christopher (cl778h) | b4e65de | 2020-03-16 11:12:15 -0400 | [diff] [blame] | 51 | ARG g12="1.12.17" |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 52 | RUN wget -nv https://dl.google.com/go/go${g12}.linux-amd64.tar.gz \ |
| 53 | && tar -xf go${g12}.linux-amd64.tar.gz \ |
| 54 | && mv go /opt/go/1.12 \ |
| 55 | && rm -f go*.gz |
yakiratz | a852e2a | 2019-11-21 09:39:36 +0200 | [diff] [blame] | 56 | |
Lott, Christopher (cl778h) | b4e65de | 2020-03-16 11:12:15 -0400 | [diff] [blame] | 57 | ARG g13="1.13.8" |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 58 | RUN wget -nv https://dl.google.com/go/go${g13}.linux-amd64.tar.gz \ |
| 59 | && tar -xf go${g13}.linux-amd64.tar.gz \ |
| 60 | && mv go /opt/go/1.13 \ |
| 61 | && rm -f go*.gz |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 62 | |
Lott, Christopher (cl778h) | b4e65de | 2020-03-16 11:12:15 -0400 | [diff] [blame] | 63 | ARG g14="1.14" |
| 64 | RUN wget -nv https://dl.google.com/go/go${g14}.linux-amd64.tar.gz \ |
| 65 | && tar -xf go${g14}.linux-amd64.tar.gz \ |
| 66 | && mv go /opt/go/1.14 \ |
| 67 | && rm -f go*.gz |
| 68 | |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 69 | ENV GOPATH=/root/go |
| 70 | # Default path has go version 1.12.x |
| 71 | # Use /opt/go/1.13/bin for version 1.13.x |
Lott, Christopher (cl778h) | b4e65de | 2020-03-16 11:12:15 -0400 | [diff] [blame] | 72 | # Use /opt/go/1.14/bin for version 1.14.x |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 73 | ENV PATH=$PATH:/opt/go/1.12/bin:$GOPATH/bin |
| 74 | |
| 75 | # This installs go-acc to GOPATH |
| 76 | RUN go version \ |
| 77 | && go get -v github.com/ory/go-acc \ |
| 78 | && go-acc --help |
| 79 | |
| 80 | # install a recent version of cmake, ubuntu repo version is old |
| 81 | ARG cv="3.14.5" |
| 82 | RUN wget -nv https://github.com/Kitware/CMake/releases/download/v${cv}/cmake-${cv}-Linux-x86_64.sh \ |
| 83 | && chmod +x cmake-${cv}-Linux-x86_64.sh \ |
| 84 | && ./cmake-${cv}-Linux-x86_64.sh --prefix=/usr/local --skip-license \ |
| 85 | && rm -f cmake*.sh |
| 86 | |
| 87 | # install a recent version of ninja-build, ubuntu repo version is old |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 88 | RUN wget -nv https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip \ |
| 89 | && unzip ninja-linux.zip \ |
| 90 | && chmod +x ninja \ |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 91 | && mv ninja /usr/local/bin \ |
| 92 | && rm -f ninja*.zip |
| 93 | |
| 94 | # sonar-scanner is not available in ubuntu repo |
| 95 | ARG sv="4.2.0.1873" |
| 96 | RUN wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${sv}-linux.zip \ |
| 97 | && unzip sonar-scanner-cli-${sv}-linux.zip \ |
| 98 | && mv sonar-scanner-${sv}-linux /usr/local/sonar-scanner \ |
| 99 | && rm -f sonar*.zip |
| 100 | |
| 101 | # golangci-lint is not available in ubuntu repo |
| 102 | RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.23.6 \ |
| 103 | && rm -f install.sh |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 104 | |
E. Scott Daniels | 134c56f | 2019-09-25 15:20:50 -0400 | [diff] [blame] | 105 | # NNG repo is not frequently tagged so it's pinned to a commit hash. |
| 106 | # This commit provides fix to the proxy-reconnect |
| 107 | # bug that we identified: https://github.com/nanomsg/nng/issues/970 |
| 108 | RUN git clone https://github.com/nanomsg/nng.git \ |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 109 | && cd nng \ |
E. Scott Daniels | 134c56f | 2019-09-25 15:20:50 -0400 | [diff] [blame] | 110 | && git checkout e618abf8f3db2a94269a79c8901a51148d48fcc2 \ |
Lott, Christopher (cl778h) | 52dc4e1 | 2019-06-12 15:27:44 -0400 | [diff] [blame] | 111 | && mkdir build \ |
| 112 | && cd build \ |
| 113 | && cmake -DBUILD_SHARED_LIBS=1 -G Ninja .. \ |
| 114 | && ninja \ |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 115 | && ninja install \ |
| 116 | && cd ../.. \ |
| 117 | && rm -rf nng |
Lott, Christopher (cl778h) | d63fe20 | 2019-06-17 09:01:48 -0400 | [diff] [blame] | 118 | |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 119 | # install a recent version of boost, ubuntu repo version is old |
| 120 | ARG bv="1_69_0" |
| 121 | RUN wget -nv https://dl.bintray.com/boostorg/release/1.69.0/source/boost_${bv}.zip \ |
| 122 | && unzip -q boost_${bv}.zip \ |
| 123 | && cd boost_${bv} \ |
Lott, Christopher (cl778h) | d63fe20 | 2019-06-17 09:01:48 -0400 | [diff] [blame] | 124 | && ./bootstrap.sh --prefix=/usr/ \ |
| 125 | && ./b2 \ |
| 126 | && ./b2 install \ |
| 127 | && cd ../ \ |
Lott, Christopher (cl778h) | bc81096 | 2020-02-06 15:18:41 -0500 | [diff] [blame] | 128 | && rm -rf boost*.zip boost_${bv} |