blob: c61aded4d3f1e4c5b29d31a51693dc413d71c7b1 [file] [log] [blame]
Katri Turunen4b74f012019-08-15 10:49:36 +03001#
2# Copyright (c) 2019 AT&T Intellectual Property.
3# Copyright (c) 2018-2019 Nokia.
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.
Roni Riska6ffba082019-11-27 10:59:54 +020016#
17# This source code is part of the near-RT RIC (RAN Intelligent Controller)
18# platform project (RICP).
19#
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020020
Anupama P520777b2021-11-12 06:35:42 -050021FROM golang:1.16 as gobuild
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020022
23# Install utilities
24RUN apt update && apt install -y iputils-ping net-tools curl sudo
Katri Turunen4b74f012019-08-15 10:49:36 +030025
26# Set the Working Directory for ves-agent inside the container
27RUN mkdir -p $GOPATH/src/VESPA
28WORKDIR $GOPATH/src/VESPA
29
30# Clone VES Agent v0.3.0 from github
31RUN git clone -b v0.3.0 https://github.com/nokia/ONAP-VESPA.git $GOPATH/src/VESPA
32
33RUN GO111MODULE=on go mod download
Anupama P520777b2021-11-12 06:35:42 -050034ENV GOLANG_VERSION 1.16
Anupama Pa1c32152021-11-09 03:05:28 -050035RUN wget --quiet https://dl.google.com/go/go$GOLANG_VERSION.linux-amd64.tar.gz \
36 && tar xvzf go$GOLANG_VERSION.linux-amd64.tar.gz -C /usr/local
Katri Turunen4b74f012019-08-15 10:49:36 +030037
38# Install VES Agent
39RUN export GOPATH=$HOME/go && \
40 export PATH=$GOPATH/bin:$GOROOT/bin:$PATH && \
41 go install -v ./ves-agent
42
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020043# Set the Working Directory for vespamgr inside the container
44RUN mkdir -p /go/src/vespamgr
45RUN mkdir -p /cfg
46COPY . /go/src/vespamgr
47WORKDIR /go/src/vespamgr
Katri Turunen4b74f012019-08-15 10:49:36 +030048
Roni Riska364295f2019-09-30 09:39:12 +030049RUN ./build_vesmgr.sh
Katri Turunen4b74f012019-08-15 10:49:36 +030050
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020051# Final, executable and deployable container
Anupama P520777b2021-11-12 06:35:42 -050052FROM ubuntu:20.04
Roni Riska9a9ecfe2019-09-25 12:28:32 +030053
Katri Turunen4b74f012019-08-15 10:49:36 +030054RUN mkdir -p /etc/ves-agent
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020055
Mohamed Abukard2c00f32020-12-09 21:09:51 +020056COPY --from=gobuild /usr/local/lib /usr/local/lib
57COPY --from=gobuild /root/go/bin /root/go/bin
58COPY --from=gobuild /root/go/bin/vespamgr /usr/local/bin/vesmgr
59COPY --from=gobuild /root/go/bin/vespamgr /vespamgr
60COPY --from=gobuild /go/src/vespamgr/config/* /cfg/
dhiraj420d3302021-04-21 18:07:26 +030061COPY --from=gobuild /go/src/vespamgr/config/plt-counter.json /cfg/plt-counter.json
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020062RUN ldconfig
63
64ENV CFG_FILE=/cfg/config-file.json
65ENV RMR_SEED_RT=/cfg/uta_rtg.rt
Katri Turunen4b74f012019-08-15 10:49:36 +030066
67ENV PATH="/root/go/bin:${PATH}"
68
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020069ENTRYPOINT ["/vespamgr"]