blob: 274669bf1ca7529fd518d626b8d3e1455fd4d5ce [file] [log] [blame]
subhash kumar singhe63192f2020-12-11 14:25:11 +05301# Copyright (c) 2020 Samsung.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15#----------------------------------------------------------
16#
17#----------------------------------------------------------
18
subhash kumar singh89540262021-07-23 01:13:11 +053019FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as build-hw-go
subhash kumar singhe63192f2020-12-11 14:25:11 +053020
subhash kumar singh89540262021-07-23 01:13:11 +053021# Install utilities
subhash kumar singhcd49a822021-10-07 18:55:34 +053022RUN apt update && apt install -y iputils-ping net-tools curl sudo ca-certificates
subhash kumar singhe63192f2020-12-11 14:25:11 +053023
subhash kumar singh89540262021-07-23 01:13:11 +053024# Install RMr shared library & development header files
25RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_4.7.0_amd64.deb/download.deb && dpkg -i rmr_4.7.0_amd64.deb && rm -rf rmr_4.7.0_amd64.deb
26RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_4.7.0_amd64.deb/download.deb && dpkg -i rmr-dev_4.7.0_amd64.deb && rm -rf rmr-dev_4.7.0_amd64.deb
27
28# Install dependencies, compile and test the module
29RUN mkdir -p /go/src/hw-go
30COPY . /go/src/hw-go
31
32WORKDIR "/go/src/hw-go"
33
34ENV GO111MODULE=on GO_ENABLED=0 GOOS=linux
35
36RUN go build -a -installsuffix cgo -o hw-go hwApp.go
37
38
39# Final deployment container
40FROM ubuntu:18.04
41
42ENV CFG_FILE=config/config-file.json
43ENV RMR_SEED_RT=config/uta_rtg.rt
44
45RUN mkdir /config
46
47COPY --from=build-hw-go /go/src/hw-go/hw-go /
48COPY --from=build-hw-go /go/src/hw-go/config/* /config/
49COPY --from=build-hw-go /usr/local/lib /usr/local/lib
50
subhash kumar singhe363aa92021-03-26 15:53:13 +053051RUN ldconfig
subhash kumar singhe63192f2020-12-11 14:25:11 +053052
subhash kumar singh89540262021-07-23 01:13:11 +053053RUN chmod 755 /hw-go
54CMD /hw-go