Define ci image with many common build tools
[ci-management.git] / docker / bldr-ubuntu-c-go-nng / Dockerfile
1 # O-RAN-SC
2 #
3 # Copyright (C) 2019 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 CI tools for most RIC components
18 # Based on Ubuntu 16.04
19 # Adds standard packages gcc and g++ 5.4, sctp boost etc.
20 # Adds Golang 1.12 from binary distro to /usr/local/go
21 # Adds Cmake 3.14.5 from binary distro to /usr/local/bin
22 # Adds Ninja 1.9 from binary distro to /usr/local/bin
23 # Adds Nanomsg Next Gen libs by cloning and building
24
25 FROM ubuntu:16.04
26
27 RUN apt-get update && apt-get install -y \
28     build-essential software-properties-common \
29     git zip wget make gcc g++  \
30     libsctp-dev lksctp-tools \
31     zlibc zlib1g zlib1g-dev \
32     python-dev autotools-dev libicu-dev libbz2-dev libboost-all-dev \
33     autoconf autoconf-archive libtool automake pkg-config
34
35 WORKDIR /tmp
36
37 RUN wget -nv https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5-Linux-x86_64.sh \
38     && chmod +x cmake-3.14.5-Linux-x86_64.sh \
39     && ./cmake-3.14.5-Linux-x86_64.sh --prefix=/usr/local --skip-license
40
41 RUN wget -nv https://dl.google.com/go/go1.12.linux-amd64.tar.gz \
42     && tar -xf go1.12.linux-amd64.tar.gz \
43     && mv go /usr/local
44
45 RUN wget -nv https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip \
46     && unzip ninja-linux.zip \
47     && chmod +x ninja \
48     && mv ninja /usr/local/bin
49
50 RUN git clone https://github.com/nanomsg/nng.git \
51     && cd nng \
52     && mkdir build \
53     && cd build \
54     && cmake -DBUILD_SHARED_LIBS=1 -G Ninja .. \
55     && ninja \
56     && ninja install