+# build and test
+COPY . /go/src/ws
+COPY ./config/config_test.yaml /opt/a1-mediator/
+
+ENV CFG_FILE=/opt/a1-mediator/config_test.yaml
+ENV A1_CONFIG_FILE=/opt/a1-mediator/config_test.yaml
+
+
+# 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/policy
+
+RUN gofmt -l $(find cmd/ pkg/ -name '*.go' -not -name '*_test.go')
+
+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 wget\
+ && apt-get clean && update-ca-certificates
+
+#Install RMR
+
+ARG RMR_VER=4.9.1