blob: 01e3994444c88863fbb11a7f6f51712fec8c89d4 [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
20FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:2-u18.04-nng as xapp-base
21
22RUN apt-get update -y \
23 &&apt-get install -y \
24 apt-utils \
25 cmake \
26 gawk \
27 sudo \
28 nano \
29 jq \
30 gettext-base \
31 bison \
32 flex \
33 curl \
34 tree
35
36RUN curl -s https://packagecloud.io/install/repositories/o-ran-sc/master/script.deb.sh | bash
37
38# RMR
39ARG RMRVERSION=1.9.0
40#RUN apt-get install -y rmr=${RMRVERSION} rmr-dev=${RMRVERSION}
41RUN 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
42RUN 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
43RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
44
45#
46RUN ldconfig
47
48#
49ENV PATH="/usr/local/go/bin:${PATH}"
50
51WORKDIR "/"
52CMD ["/bin/bash"]
53
54#----------------------------------------------------------
55#
56#----------------------------------------------------------
57FROM xapp-base as xapp-base-testbuild
58
59
60RUN mkdir -p /ws
61WORKDIR "/ws"
62
63# Module prepare (if go.mod/go.sum updated)
64COPY go.mod /ws
65COPY go.sum /ws
66RUN go mod download
67
68# Copy
69COPY . /ws
70
71# Build
72RUN make -C /ws go-build
73
74# Test fmt
75RUN make -C /ws go-test-fmt
76
77# Test Requires dbaas
78#RUN make -C /ws go-test