X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=a1-go%2FDockerfile;h=1a4cfecb542559b4eccde2376fd9554bf24c5bd2;hb=9f4fe4d725c9ad77ea1c2ab565ce5759e8a932a6;hp=a89ed15dae5aaf5c1569710e836ecfbca49572cc;hpb=2705dc9e68c52693a510aca78a8c74c7fb042c7c;p=ric-plt%2Fa1.git diff --git a/a1-go/Dockerfile b/a1-go/Dockerfile index a89ed15..1a4cfec 100644 --- a/a1-go/Dockerfile +++ b/a1-go/Dockerfile @@ -16,6 +16,18 @@ 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 # Update CA certificates @@ -65,6 +77,7 @@ RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /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')