blob: 83031145c94ddb73f1b1e65c4040f986e45be05c [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
Lott, Christopher (cl778h)b5537932020-02-12 17:30:11 -050020FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:4-u18.04-nng 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
Mohamed Abukar5953f7e2020-04-02 10:08:14 +030038ARG RMRVERSION=3.6.5
Juha Hyttinen6e075ce2019-11-06 08:42:34 +020039#RUN apt-get install -y rmr=${RMRVERSION} rmr-dev=${RMRVERSION}
40RUN wget --content-disposition https://packagecloud.io/o-ran-sc/staging/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/staging/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
42RUN 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