From 57174356ce7614bceddc8822610785726bf4216f Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Mon, 23 Mar 2020 17:35:15 -0400 Subject: [PATCH] Add Dockerfiles with base build images Migrate active Dockerfiles out of ci-management repo to reduce turn-around time on changes. Upgrade RMR in Alpine images to version 3.6.2 Upgrade Golang in Ubuntu image to 1.12.17, 1.13.9, 1.14.1 Issue-ID: INT-108 Signed-off-by: Lott, Christopher (cl778h) Change-Id: I2d2bf510dc01c34bc0888fac7a78f817e27d92b9 --- .gitattributes | 21 ++++ .gitreview | 1 + bldr-imgs/README.md | 8 ++ bldr-imgs/bldr-alpine3-go/Dockerfile | 33 ++++++ bldr-imgs/bldr-alpine3-go/container-tag.yaml | 2 + bldr-imgs/bldr-alpine3/Dockerfile | 74 ++++++++++++++ bldr-imgs/bldr-alpine3/container-tag.yaml | 3 + bldr-imgs/bldr-ubuntu18-c-go/Dockerfile | 128 ++++++++++++++++++++++++ bldr-imgs/bldr-ubuntu18-c-go/container-tag.yaml | 4 + 9 files changed, 274 insertions(+) create mode 100644 .gitattributes create mode 100644 bldr-imgs/README.md create mode 100644 bldr-imgs/bldr-alpine3-go/Dockerfile create mode 100644 bldr-imgs/bldr-alpine3-go/container-tag.yaml create mode 100644 bldr-imgs/bldr-alpine3/Dockerfile create mode 100644 bldr-imgs/bldr-alpine3/container-tag.yaml create mode 100644 bldr-imgs/bldr-ubuntu18-c-go/Dockerfile create mode 100644 bldr-imgs/bldr-ubuntu18-c-go/container-tag.yaml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..38b6a85 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,21 @@ +# https://help.github.com/articles/dealing-with-line-endings/ + +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized +# and converted to native line endings on checkout. +*.css text +*.htm text diff=html +*.html text diff=html +*.java text diff=java +*.js text +*.jsp text +*.less text +*.properties text +*.sql text +*.xml text + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary diff --git a/.gitreview b/.gitreview index a06daa3..ee6804b 100644 --- a/.gitreview +++ b/.gitreview @@ -3,3 +3,4 @@ host=gerrit.o-ran-sc.org port=29418 project=it/dev defaultbranch=master +defaultremote=origin diff --git a/bldr-imgs/README.md b/bldr-imgs/README.md new file mode 100644 index 0000000..b193284 --- /dev/null +++ b/bldr-imgs/README.md @@ -0,0 +1,8 @@ +# Base builder images for O-RAN-SC + +This area contains Dockerfiles for images suitable for use as the +first stage in a multi-stage Docker build. These images have large +build and compile tools like C, C++, Golang, cmake, ninja, etc. +Using these base images reduces the time needed to build Docker +images with project features. The images are published to the O-RAN-SC +Nexus3 staging registry at the Linux Foundation. diff --git a/bldr-imgs/bldr-alpine3-go/Dockerfile b/bldr-imgs/bldr-alpine3-go/Dockerfile new file mode 100644 index 0000000..16bd1ac --- /dev/null +++ b/bldr-imgs/bldr-alpine3-go/Dockerfile @@ -0,0 +1,33 @@ +# ================================================================================== +# Copyright (c) 2020 Nokia +# Copyright (c) 2020 AT&T Intellectual Property. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ================================================================================== + +# Has: +# golang 1.13.8 +# alpine 3.11 +# rmr 3.x +# Installing this version of rmr also pulls in nng + +# install a well known working rmr +FROM golang:1.13.8-alpine3.11 +RUN apk update && apk add autoconf automake build-base cmake libtool ninja pkgconfig git sudo +RUN git clone --branch 3.6.2 https://gerrit.oran-osc.org/r/ric-plt/lib/rmr \ + && cd rmr \ + && mkdir .build; cd .build \ + && echo "<<>>" \ + && cmake .. -DDEV_PKG=1; make install \ + && echo "<<< installing rmr .so>>>" \ + && cmake .. -DPACK_EXTERNALS=1; make install diff --git a/bldr-imgs/bldr-alpine3-go/container-tag.yaml b/bldr-imgs/bldr-alpine3-go/container-tag.yaml new file mode 100644 index 0000000..9b299dd --- /dev/null +++ b/bldr-imgs/bldr-alpine3-go/container-tag.yaml @@ -0,0 +1,2 @@ +--- +tag: 4-a3.11-nng-rmr3 diff --git a/bldr-imgs/bldr-alpine3/Dockerfile b/bldr-imgs/bldr-alpine3/Dockerfile new file mode 100644 index 0000000..0ec0e7f --- /dev/null +++ b/bldr-imgs/bldr-alpine3/Dockerfile @@ -0,0 +1,74 @@ +# O-RAN-SC +# +# Copyright (C) 2019-2020 AT&T Intellectual Property and Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This is an all-things-to-all-ORAN-people build image with: +# alpine v 3.11 +# gcc/g++ v 8 +# golang v 1.13.4 +# python 3.7 +# mdc log libs (libmdclog.so, libmdbclog.so.X.X.X; see below for pinned version) +# nng libs (rmr.h, libnng.so, libnng.so.X.X.X; version pinned by RMR) +# rmr libs (librmr_nng.so, librmr_si.so, librmr_nng.so.X.X.X, librmr_si.so.X.X.X; see below for pinned version) +# +# Some packages (e.g., mdclog) install to /usr/local/lib, others (e.g., rmr) install to /usr/local/lib64 +# Alpine by default searches /usr/local/lib but not /usr/local/lib64 +# +# How to get library files from this Docker base image: +# COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:TAG /usr/local/lib/libmdclog.so.X.X.X /usr/local/lib +# COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:TAG /usr/local/lib64/libnng.so.X.X.X /usr/local/lib +# COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:TAG /usr/local/lib64/librmr_nng.so.X.X.X /usr/local/lib +# COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:TAG /usr/local/lib64/librmr_si.so.X.X.X /usr/local/lib + +FROM python:3.7-alpine +RUN apk update && apk add \ + autoconf \ + automake \ + build-base \ + cmake \ + libtool \ + ninja \ + pkgconfig \ + python-dev \ + sudo \ + git \ + go + +# the autoconf-archive in alpine's edge repos is too new +# for our purposes, so we'll use one from the source. +RUN cd /tmp \ + && git clone --branch v2015.09.25 git://git.sv.gnu.org/autoconf-archive.git \ + && cp /tmp/autoconf-archive/m4/* /usr/share/aclocal \ + && rm -rf /tmp/autoconf-archive + +# MCDLOG, version is pinned +RUN cd /tmp \ + && git clone --branch v0.0.4 https://gerrit.o-ran-sc.org/r/com/log \ + && cd log \ + && ./autogen.sh \ + && ./configure \ + && make \ + && make install + +# install a well known working rmr including development header files, +# which uses a submodule to install NNG at a known commit +RUN apk update && apk add autoconf automake build-base cmake libtool ninja pkgconfig git sudo +RUN git clone --branch 3.6.2 https://gerrit.oran-osc.org/r/ric-plt/lib/rmr \ + && cd rmr \ + && mkdir .build; cd .build \ + && echo "<<>>" \ + && cmake .. -DDEV_PKG=1; make install \ + && echo "<<< installing rmr .so>>>" \ + && cmake .. -DPACK_EXTERNALS=1; make install diff --git a/bldr-imgs/bldr-alpine3/container-tag.yaml b/bldr-imgs/bldr-alpine3/container-tag.yaml new file mode 100644 index 0000000..c9184ae --- /dev/null +++ b/bldr-imgs/bldr-alpine3/container-tag.yaml @@ -0,0 +1,3 @@ +# Not feasible to show all the software versions +--- +tag: 8-a3.11-nng-rmr3 diff --git a/bldr-imgs/bldr-ubuntu18-c-go/Dockerfile b/bldr-imgs/bldr-ubuntu18-c-go/Dockerfile new file mode 100644 index 0000000..6742e97 --- /dev/null +++ b/bldr-imgs/bldr-ubuntu18-c-go/Dockerfile @@ -0,0 +1,128 @@ +# O-RAN-SC +# +# Copyright (C) 2019-2020 AT&T Intellectual Property and Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Builder image with superset of CI tools for RIC components + +FROM nexus3.o-ran-sc.org:10001/ubuntu:18.04 + +RUN apt-get update && apt-get install -y \ + autoconf \ + autoconf-archive \ + automake \ + autotools-dev \ + build-essential \ + g++ \ + gcc \ + git \ + libbz2-dev \ + libicu-dev \ + libsctp-dev \ + libtool \ + lksctp-tools \ + make \ + python-dev \ + pkg-config \ + software-properties-common \ + sudo \ + wget \ + zlib1g \ + zlib1g-dev \ + zlibc \ + zip + +WORKDIR /tmp + +# Install go versions in /opt +RUN mkdir -p /opt/go + +ARG g12="1.12.17" +RUN wget -nv https://dl.google.com/go/go${g12}.linux-amd64.tar.gz \ + && tar -xf go${g12}.linux-amd64.tar.gz \ + && mv go /opt/go/1.12 \ + && rm -f go*.gz + +ARG g13="1.13.9" +RUN wget -nv https://dl.google.com/go/go${g13}.linux-amd64.tar.gz \ + && tar -xf go${g13}.linux-amd64.tar.gz \ + && mv go /opt/go/1.13 \ + && rm -f go*.gz + +ARG g14="1.14.1" +RUN wget -nv https://dl.google.com/go/go${g14}.linux-amd64.tar.gz \ + && tar -xf go${g14}.linux-amd64.tar.gz \ + && mv go /opt/go/1.14 \ + && rm -f go*.gz + +ENV GOPATH=/root/go +# Default path has go version 1.12.x +# Use /opt/go/1.13/bin for version 1.13.x +# Use /opt/go/1.14/bin for version 1.14.x +ENV PATH=$PATH:/opt/go/1.12/bin:$GOPATH/bin + +# This installs go-acc to GOPATH +RUN go version \ + && go get -v github.com/ory/go-acc \ + && go-acc --help + +# install a recent version of cmake, ubuntu repo version is old +ARG cv="3.14.5" +RUN wget -nv https://github.com/Kitware/CMake/releases/download/v${cv}/cmake-${cv}-Linux-x86_64.sh \ + && chmod +x cmake-${cv}-Linux-x86_64.sh \ + && ./cmake-${cv}-Linux-x86_64.sh --prefix=/usr/local --skip-license \ + && rm -f cmake*.sh + +# install a recent version of ninja-build, ubuntu repo version is old +RUN wget -nv https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip \ + && unzip ninja-linux.zip \ + && chmod +x ninja \ + && mv ninja /usr/local/bin \ + && rm -f ninja*.zip + +# sonar-scanner is not available in ubuntu repo +ARG sv="4.2.0.1873" +RUN wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${sv}-linux.zip \ + && unzip sonar-scanner-cli-${sv}-linux.zip \ + && mv sonar-scanner-${sv}-linux /usr/local/sonar-scanner \ + && rm -f sonar*.zip + +# golangci-lint is not available in ubuntu repo +RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.23.6 \ + && rm -f install.sh + +# NNG repo is not frequently tagged so it's pinned to a commit hash. +# This commit provides fix to the proxy-reconnect +# bug that we identified: https://github.com/nanomsg/nng/issues/970 +RUN git clone https://github.com/nanomsg/nng.git \ + && cd nng \ + && git checkout e618abf8f3db2a94269a79c8901a51148d48fcc2 \ + && mkdir build \ + && cd build \ + && cmake -DBUILD_SHARED_LIBS=1 -G Ninja .. \ + && ninja \ + && ninja install \ + && cd ../.. \ + && rm -rf nng + +# install a recent version of boost, ubuntu repo version is old +ARG bv="1_69_0" +RUN wget -nv https://dl.bintray.com/boostorg/release/1.69.0/source/boost_${bv}.zip \ + && unzip -q boost_${bv}.zip \ + && cd boost_${bv} \ + && ./bootstrap.sh --prefix=/usr/ \ + && ./b2 \ + && ./b2 install \ + && cd ../ \ + && rm -rf boost*.zip boost_${bv} diff --git a/bldr-imgs/bldr-ubuntu18-c-go/container-tag.yaml b/bldr-imgs/bldr-ubuntu18-c-go/container-tag.yaml new file mode 100644 index 0000000..c9e1960 --- /dev/null +++ b/bldr-imgs/bldr-ubuntu18-c-go/container-tag.yaml @@ -0,0 +1,4 @@ +# Not feasible to show all the software versions +# here so just use a counter plus the base image +--- +tag: 6-u18.04-nng -- 2.16.6