blob: 1e2d663ab0c3f00e1338e5643038ecb55a6491a2 [file] [log] [blame]
Juha Hyttinen6e075ce2019-11-06 08:42:34 +02001# Copyright (c) 2019 AT&T Intellectual Property.
2# Copyright (c) 2019 Nokia.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16#----------------------------------------------------------
17#
18#----------------------------------------------------------
19
wahidwd9ff71c2020-12-29 06:52:39 +000020FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as xapp-base
Juha Hyttinen6e075ce2019-11-06 08:42:34 +020021RUN apt-get update -y \
22 &&apt-get install -y \
23 apt-utils \
24 cmake \
25 gawk \
26 sudo \
27 nano \
28 jq \
29 gettext-base \
30 bison \
31 flex \
32 curl \
33 tree
34
35RUN curl -s https://packagecloud.io/install/repositories/o-ran-sc/master/script.deb.sh | bash
36
37# RMR
Juha Hyttinen0bf16512020-10-01 09:50:27 +030038ARG RMRVERSION=4.2.2
Juha Hyttinen6e075ce2019-11-06 08:42:34 +020039#RUN apt-get install -y rmr=${RMRVERSION} rmr-dev=${RMRVERSION}
Juha Hyttinenf619d032020-05-07 12:42:26 +030040RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb
41RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
Juha Hyttinen6e075ce2019-11-06 08:42:34 +020042RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
43
44#
45RUN ldconfig
46
47#
48ENV PATH="/usr/local/go/bin:${PATH}"
49
50WORKDIR "/"
51CMD ["/bin/bash"]
52
53#----------------------------------------------------------
54#
55#----------------------------------------------------------
56FROM xapp-base as xapp-base-testbuild
57
58
59RUN mkdir -p /ws
60WORKDIR "/ws"
61
62# Module prepare (if go.mod/go.sum updated)
63COPY go.mod /ws
64COPY go.sum /ws
65RUN go mod download
66
67# Copy
68COPY . /ws
69
70# Build
71RUN make -C /ws go-build
72
73# Test fmt
74RUN make -C /ws go-test-fmt
75
76# Test Requires dbaas
Juha Hyttinen3cfee962020-02-13 13:51:00 +020077RUN make -C /ws go-test