Release image version 1.1.2
[ric-app/hw-go.git] / Dockerfile
1 #   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
19 FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.0.0 as build-hw-go
20
21 # Install utilities
22 RUN apt update && apt install -y iputils-ping net-tools curl sudo ca-certificates
23
24 # Install RMr shared library & development header files
25 RUN 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
26 RUN 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
29 RUN mkdir -p /go/src/hw-go
30 COPY . /go/src/hw-go
31
32 WORKDIR "/go/src/hw-go"
33
34 ENV GO111MODULE=on GO_ENABLED=0 GOOS=linux
35
36 RUN go build -a -installsuffix cgo -o hw-go hwApp.go
37
38
39 # Final deployment container
40 FROM ubuntu:18.04
41
42 ENV CFG_FILE=config/config-file.json
43 ENV RMR_SEED_RT=config/uta_rtg.rt
44
45 RUN mkdir /config
46
47 COPY --from=build-hw-go /go/src/hw-go/hw-go /
48 COPY --from=build-hw-go /go/src/hw-go/config/* /config/
49 COPY --from=build-hw-go /usr/local/lib /usr/local/lib
50
51 RUN ldconfig
52
53 RUN chmod 755 /hw-go
54 CMD /hw-go