Advance version for Dockerfile base image
[ric-plt/appmgr.git] / Dockerfile
index 027e372..5b0bf95 100755 (executable)
@@ -15,7 +15,7 @@
 
 #----------------------------------------------------------
 
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:2-u18.04-nng AS appmgr-build
+FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:3-u18.04-nng AS appmgr-build
 
 RUN apt-get update -y && apt-get install -y jq
 
@@ -52,13 +52,18 @@ RUN GO111MODULE=on go mod download
 # build and test
 COPY . /go/src/ws
 
+# Generate Swagger code
 RUN /go/bin/swagger generate server -f api/appmgr_rest_api.yaml --name AppManager -t pkg/ --exclude-main
 
 COPY . /go/src/ws
 
-RUN make -C /go/src/ws go-build
+# Build the code
+RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/src/ws/cache/go/cmd/appmgr cmd/appmgr.go
 
-RUN make -C /go/src/ws go-test-fmt
+# Run unit tests
+RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/cm/ ./pkg/helm/ ./pkg/resthooks/
+
+RUN gofmt -l $(find cmd/ pkg/  -name '*.go' -not -name '*_test.go')
 
 CMD ["/bin/bash"]