blob: 074b44a7caf96edbe1b467415af4734eca88b94a [file] [log] [blame]
Tommy Carpenter296f8de2019-08-07 11:38:44 -04001# ==================================================================================
2# Copyright (c) 2019 Nokia
3# Copyright (c) 2018-2019 AT&T Intellectual Property.
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# ==================================================================================
Tommy Carpenter40caa312019-09-12 16:24:10 -040017# install a well known working rmr
18FROM python:3.7-alpine
Tommy Carpentera0876ef2019-10-02 11:15:04 -040019RUN apk update && apk add autoconf automake build-base cmake libtool ninja pkgconfig git
20RUN git clone --branch 1.9.0 https://gerrit.o-ran-sc.org/r/ric-plt/lib/rmr \
Tommy Carpenter40caa312019-09-12 16:24:10 -040021 && cd rmr \
22 && mkdir build \
23 && cd build \
24 && cmake .. -DPACK_EXTERNALS=1 \
25 && make install
26
Tommy Carpenter296f8de2019-08-07 11:38:44 -040027FROM python:3.7-alpine
28
Tommy Carpenter296f8de2019-08-07 11:38:44 -040029# dir that rmr routing file temp goes into
30RUN mkdir -p /opt/route/
31
Tommy Carpenter7cec82d2019-10-14 16:18:21 -040032# Gevent needs gcc
Tommy Carpenter296f8de2019-08-07 11:38:44 -040033RUN apk add gcc musl-dev
34
Tommy Carpenter7cec82d2019-10-14 16:18:21 -040035# Upgrade pip, install tox (gevent is installed as a speed hack in local dev where tox is run many times)
36RUN pip install --upgrade pip && pip install tox gevent
Tommy Carpenter296f8de2019-08-07 11:38:44 -040037
Tommy Carpenter30a7bdc2019-09-23 09:48:23 -040038# copies
39COPY --from=0 /usr/local/lib64/libnng.so /usr/local/lib64/libnng.so
40COPY --from=0 /usr/local/lib64/librmr_nng.so /usr/local/lib64/librmr_nng.so
41COPY a1/ /tmp/a1
42COPY tests/ /tmp/tests
43COPY setup.py tox.ini /tmp/
44WORKDIR /tmp
45
Tommy Carpenter296f8de2019-08-07 11:38:44 -040046# Run the unit tests
47RUN tox