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 | # |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 20 | # Start from golang v1.12 base image |
| 21 | FROM golang:1.12 as gobuild |
| 22 | |
| 23 | # Set the Working Directory for ves-agent inside the container |
| 24 | RUN mkdir -p $GOPATH/src/VESPA |
| 25 | WORKDIR $GOPATH/src/VESPA |
| 26 | |
| 27 | # Clone VES Agent v0.3.0 from github |
| 28 | RUN git clone -b v0.3.0 https://github.com/nokia/ONAP-VESPA.git $GOPATH/src/VESPA |
| 29 | |
| 30 | RUN GO111MODULE=on go mod download |
| 31 | |
| 32 | # Install VES Agent |
| 33 | RUN export GOPATH=$HOME/go && \ |
| 34 | export PATH=$GOPATH/bin:$GOROOT/bin:$PATH && \ |
| 35 | go install -v ./ves-agent |
| 36 | |
| 37 | # Set the Working Directory for vesmgr inside the container |
| 38 | RUN mkdir -p $GOPATH/src/vesmgr |
| 39 | WORKDIR $GOPATH/src/vesmgr |
| 40 | |
| 41 | # Copy vesmgr to the Working Directory |
| 42 | COPY $HOME/ . |
| 43 | |
Roni Riska | 364295f | 2019-09-30 09:39:12 +0300 | [diff] [blame] | 44 | RUN ./build_vesmgr.sh |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 45 | |
| 46 | ################# |
| 47 | # |
| 48 | # Second phase, copy compiled stuff to a runtime container |
| 49 | |
| 50 | # Ubuntu or something smaller? |
| 51 | FROM ubuntu:18.04 |
Roni Riska | 9a9ecfe | 2019-09-25 12:28:32 +0300 | [diff] [blame] | 52 | # For trouble-shooting |
| 53 | RUN apt-get update; apt-get install -y \ |
| 54 | iputils-ping \ |
| 55 | net-tools \ |
Roni Riska | 3d09783 | 2019-10-03 12:16:09 +0300 | [diff] [blame] | 56 | curl \ |
| 57 | tcpdump |
Roni Riska | 9a9ecfe | 2019-09-25 12:28:32 +0300 | [diff] [blame] | 58 | |
Katri Turunen | 4b74f01 | 2019-08-15 10:49:36 +0300 | [diff] [blame] | 59 | # Create the configuration directory for ves agent |
| 60 | RUN mkdir -p /etc/ves-agent |
| 61 | COPY --from=gobuild root/go/bin /root/go/bin |
| 62 | |
| 63 | ENV PATH="/root/go/bin:${PATH}" |
| 64 | |
| 65 | ENTRYPOINT ["vesmgr"] |