Add Dockerfiles with base build images
[it/dev.git] / bldr-imgs / bldr-alpine3 / 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 # This is an all-things-to-all-ORAN-people build image with:
18 # alpine v 3.11
19 # gcc/g++ v 8
20 # golang v 1.13.4
21 # python 3.7
22 # mdc log libs (libmdclog.so, libmdbclog.so.X.X.X; see below for pinned version)
23 # nng libs (rmr.h, libnng.so, libnng.so.X.X.X; version pinned by RMR)
24 # 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)
25 #
26 # Some packages (e.g., mdclog) install to /usr/local/lib, others (e.g., rmr) install to /usr/local/lib64
27 # Alpine by default searches /usr/local/lib but not /usr/local/lib64
28 #
29 # How to get library files from this Docker base image:
30 # COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:TAG /usr/local/lib/libmdclog.so.X.X.X    /usr/local/lib
31 # COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:TAG /usr/local/lib64/libnng.so.X.X.X     /usr/local/lib
32 # COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:TAG /usr/local/lib64/librmr_nng.so.X.X.X /usr/local/lib
33 # COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:TAG /usr/local/lib64/librmr_si.so.X.X.X  /usr/local/lib
34
35 FROM python:3.7-alpine
36 RUN apk update && apk add \
37   autoconf \
38   automake \
39   build-base \
40   cmake \
41   libtool \
42   ninja \
43   pkgconfig \
44   python-dev \
45   sudo \
46   git \
47   go
48
49 # the autoconf-archive in alpine's edge repos is too new
50 # for our purposes, so we'll use one from the source.
51 RUN cd /tmp \
52     && git clone --branch v2015.09.25 git://git.sv.gnu.org/autoconf-archive.git \
53     && cp /tmp/autoconf-archive/m4/* /usr/share/aclocal \
54     && rm -rf /tmp/autoconf-archive
55
56 # MCDLOG, version is pinned
57 RUN cd /tmp \
58    && git clone --branch v0.0.4 https://gerrit.o-ran-sc.org/r/com/log \
59    && cd log \
60    && ./autogen.sh \
61    && ./configure \
62    && make \
63    && make install
64
65 # install a well known working rmr including development header files,
66 # which uses a submodule to install NNG at a known commit
67 RUN apk update && apk add autoconf automake build-base cmake libtool ninja pkgconfig git sudo
68 RUN git clone --branch 3.6.2 https://gerrit.oran-osc.org/r/ric-plt/lib/rmr \
69     && cd rmr \
70     && mkdir .build; cd .build \
71     && echo "<<<installing rmr devel headers>>>" \
72     && cmake .. -DDEV_PKG=1; make install \
73     && echo "<<< installing rmr .so>>>" \
74     && cmake .. -DPACK_EXTERNALS=1; make install