X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=a1-go%2FDockerfile;h=1a4cfecb542559b4eccde2376fd9554bf24c5bd2;hb=9f4fe4d725c9ad77ea1c2ab565ce5759e8a932a6;hp=be0eafb18fb9bd8f5007a90008bec0b42d184c0a;hpb=6bc8f8ef64a7e90f550dea4af6a10d785d8aeca6;p=ric-plt%2Fa1.git diff --git a/a1-go/Dockerfile b/a1-go/Dockerfile index be0eafb..1a4cfec 100644 --- a/a1-go/Dockerfile +++ b/a1-go/Dockerfile @@ -14,7 +14,19 @@ #----------------------------------------------------------- -FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 AS a1-build +FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.1.0 AS a1-build + + +#TODO check why defualt golang is not working +ARG GOVERSION="1.18.5" +RUN wget -nv https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz \ + && tar -xf go${GOVERSION}.linux-amd64.tar.gz \ + && mv go /opt/go/${GOVERSION} \ + && rm -f go*.gz + + +ENV DEFAULTPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PATH=$DEFAULTPATH:/usr/local/go/bin:/opt/go/${GOVERSION}/bin:/root/go/bin RUN apt-get update -y && apt-get install -y jq @@ -24,6 +36,18 @@ RUN apt update && apt install --reinstall -y \ && \ update-ca-certificates +#Install RMR + +ARG RMR_VER=4.8.3 +ARG RMR_PKG_URL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/ + +RUN wget -nv --content-disposition ${RMR_PKG_URL}/rmr_${RMR_VER}_amd64.deb/download.deb +RUN wget -nv --content-disposition ${RMR_PKG_URL}/rmr-dev_${RMR_VER}_amd64.deb/download.deb +RUN dpkg -i rmr_${RMR_VER}_amd64.deb \ + && dpkg -i rmr-dev_${RMR_VER}_amd64.deb \ + && ldconfig + + ENV PATH="/usr/local/go/bin:${PATH}" ENV GOPATH="/go" @@ -40,12 +64,20 @@ RUN GO111MODULE=on go mod download # build and test COPY . /go/src/ws +COPY ./config/uta_rtg.rt /opt/a1-mediator/ + +ENV RMR_RTG_SVC=-1 +ENV RMR_LOG_VLEVEL=5 +ENV CFG_FILE=/opt/a1-mediator/config-file.json +ENV RMR_SEED_RT=/opt/a1-mediator/uta_rtg.rt + # Build the code RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/src/ws/cache/go/cmd/a1 cmd/a1.go # Run unit tests RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/resthooks/ RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/a1/ +RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/policyManager RUN gofmt -l $(find cmd/ pkg/ -name '*.go' -not -name '*_test.go') @@ -56,9 +88,20 @@ CMD ["/bin/bash"] FROM ubuntu:18.04 as a1-mediator RUN apt-get update -y \ - && apt-get install --reinstall -y sudo openssl ca-certificates ca-cacert \ + && apt-get install --reinstall -y sudo openssl ca-certificates ca-cacert wget\ && apt-get clean && update-ca-certificates +#Install RMR + +ARG RMR_VER=4.8.3 +ARG RMR_PKG_URL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/ + +RUN wget -nv --content-disposition ${RMR_PKG_URL}/rmr_${RMR_VER}_amd64.deb/download.deb +RUN wget -nv --content-disposition ${RMR_PKG_URL}/rmr-dev_${RMR_VER}_amd64.deb/download.deb +RUN dpkg -i rmr_${RMR_VER}_amd64.deb \ + && dpkg -i rmr-dev_${RMR_VER}_amd64.deb \ + && ldconfig + # # a1-mediator #