Fixing Dockerfile 05/5805/1
authorsubhash kumar singh <subh.singh@samsung.com>
Fri, 26 Mar 2021 10:23:13 +0000 (15:53 +0530)
committersubhash kumar singh <subh.singh@samsung.com>
Fri, 26 Mar 2021 10:23:13 +0000 (15:53 +0530)
Fixing Dockerfile to build and run hw-go.

Signed-off-by: subhash kumar singh <subh.singh@samsung.com>
Change-Id: I24e164fd2f4e05eb4a5bc84171c8ca4e4cb9c1dc

Dockerfile

index 9c3c11e..b7d6e3e 100755 (executable)
 #
 #----------------------------------------------------------
 
-FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 as xapp-base
-RUN apt-get update -y \
-    &&apt-get install -y \
-    apt-utils \
-    cmake \
-    gawk \
-    sudo \
-    nano \
-    jq \
-    gettext-base \
-    bison \
-    flex \
-    curl \
-    tree
+FROM golang:1.15
 
-RUN curl -s https://packagecloud.io/install/repositories/o-ran-sc/master/script.deb.sh | bash
-
-# RMR
-ARG RMRVERSION=4.2.2
-#RUN apt-get install -y rmr=${RMRVERSION} rmr-dev=${RMRVERSION}
+ARG RMRVERSION=4.5.2
 RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb
 RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
-RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
-
-#
-RUN ldconfig
-
-#
-ENV PATH="/usr/local/go/bin:${PATH}"
-
-WORKDIR "/"
-CMD ["/bin/bash"]
-
-#----------------------------------------------------------
-#
-#----------------------------------------------------------
-FROM xapp-base as xapp-base-testbuild
-
-
 RUN mkdir -p /ws
 WORKDIR "/ws"
 
 COPY . /ws
-# Module prepare (if go.mod/go.sum updated)
-#COPY go.mod /ws
-#COPY go.sum /ws
-#RUN go mod download
-
-#RUN go build hwApp.go
+RUN ldconfig
+RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o hw-app hwApp.go
+#CMD RMR_SEED_RT=config/uta_rtg.rt ./hw-app -f config/test-config.json
+CMD RMR_SEED_RT=config/uta_rtg.rt ./hw-app -f config/config-file.json