Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 1 | # |
| 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 Riska | 6ffba08 | 2019-11-27 10:59:54 +0200 | [diff] [blame] | 16 | # |
| 17 | # This source code is part of the near-RT RIC (RAN Intelligent Controller) |
| 18 | # platform project (RICP). |
| 19 | # |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 20 | |
manoj1 | f483354 | 2021-10-29 06:23:41 -0400 | [diff] [blame] | 21 | FROM golang:1.16 as gobuild |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 22 | |
| 23 | # Install utilities |
| 24 | RUN apt update && apt install -y iputils-ping net-tools curl sudo |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 25 | |
| 26 | # Set the Working Directory for ves-agent inside the container |
| 27 | RUN mkdir -p $GOPATH/src/VESPA |
| 28 | WORKDIR $GOPATH/src/VESPA |
| 29 | |
| 30 | # Clone VES Agent v0.3.0 from github |
| 31 | RUN git clone -b v0.3.0 https://github.com/nokia/ONAP-VESPA.git $GOPATH/src/VESPA |
| 32 | |
| 33 | RUN GO111MODULE=on go mod download |
| 34 | |
| 35 | # Install VES Agent |
| 36 | RUN export GOPATH=$HOME/go && \ |
| 37 | export PATH=$GOPATH/bin:$GOROOT/bin:$PATH && \ |
| 38 | go install -v ./ves-agent |
| 39 | |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 40 | # Set the Working Directory for vespamgr inside the container |
| 41 | RUN mkdir -p /go/src/vespamgr |
| 42 | RUN mkdir -p /cfg |
| 43 | COPY . /go/src/vespamgr |
| 44 | WORKDIR /go/src/vespamgr |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 45 | |
Roni Riska | 364295f | 2019-09-30 09:39:12 +0300 | [diff] [blame] | 46 | RUN ./build_vesmgr.sh |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 47 | |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 48 | # Final, executable and deployable container |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 49 | FROM ubuntu:18.04 |
Roni Riska | 9a9ecfe | 2019-09-25 12:28:32 +0300 | [diff] [blame] | 50 | |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 51 | RUN mkdir -p /etc/ves-agent |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 52 | |
Mohamed Abukar | d2c00f3 | 2020-12-09 21:09:51 +0200 | [diff] [blame] | 53 | COPY --from=gobuild /usr/local/lib /usr/local/lib |
| 54 | COPY --from=gobuild /root/go/bin /root/go/bin |
| 55 | COPY --from=gobuild /root/go/bin/vespamgr /usr/local/bin/vesmgr |
| 56 | COPY --from=gobuild /root/go/bin/vespamgr /vespamgr |
| 57 | COPY --from=gobuild /go/src/vespamgr/config/* /cfg/ |
dhiraj | 420d330 | 2021-04-21 18:07:26 +0300 | [diff] [blame] | 58 | COPY --from=gobuild /go/src/vespamgr/config/plt-counter.json /cfg/plt-counter.json |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 59 | RUN ldconfig |
| 60 | |
| 61 | ENV CFG_FILE=/cfg/config-file.json |
| 62 | ENV RMR_SEED_RT=/cfg/uta_rtg.rt |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 63 | |
| 64 | ENV PATH="/root/go/bin:${PATH}" |
| 65 | |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 66 | ENTRYPOINT ["/vespamgr"] |