RIC-851: Updated xapp-frame to define message type
[ric-plt/xapp-frame.git] / ci / Dockerfile
1 #   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
20 FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.0.0 as xapp-base
21
22
23 RUN apt-get update -y \
24     &&apt-get install -y \
25     apt-utils \
26     cmake \
27     gawk \
28     sudo \
29     nano \
30     jq \
31     gettext-base \
32     bison \
33     flex \
34     curl \
35     tree
36
37 RUN curl -s https://packagecloud.io/install/repositories/o-ran-sc/master/script.deb.sh | bash
38
39 # RMR
40 ARG RMRVERSION=4.9.0
41 #RUN apt-get install -y rmr=${RMRVERSION} rmr-dev=${RMRVERSION}
42 RUN 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
43 RUN 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
44 RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
45
46 #
47 RUN ldconfig
48
49 #
50 ENV PATH="/usr/local/go/bin:${PATH}"
51
52 WORKDIR "/"
53 CMD ["/bin/bash"]
54
55 #----------------------------------------------------------
56 #
57 #----------------------------------------------------------
58 FROM xapp-base as xapp-base-testbuild
59
60
61 RUN mkdir -p /ws
62 WORKDIR "/ws"
63
64 # Module prepare (if go.mod/go.sum updated)
65 COPY go.mod /ws
66 COPY go.sum /ws
67 RUN go mod download
68
69 # Copy
70 COPY . /ws
71
72 # Build
73 RUN make -C /ws go-build
74
75 # Test fmt
76 RUN make -C /ws go-test-fmt
77
78 #RUN sed -r  "s/^(::1.*)/#\1/" /etc/hosts  > /etc/hosts.new \
79 #    && cat /etc/hosts.new > /etc/hosts \
80 #    && cat /etc/hosts  \
81 #    && make -C /ws go-test
82
83 RUN  make -C /ws go-test