From 75ac451ebe1f1994a837ec57519b4def5b5027d6 Mon Sep 17 00:00:00 2001 From: Mirko Teodorovic Date: Tue, 28 Jan 2020 14:50:22 +0100 Subject: [PATCH] NOISSUE - Remove deployments and fix mqtt client id (#17) * remove deployments Signed-off-by: Mirko Teodorovic * change mqtt client id Signed-off-by: Mirko Teodorovic --- cmd/main.go | 3 ++- deployments/Dockerfile | 17 ----------------- 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 deployments/Dockerfile diff --git a/cmd/main.go b/cmd/main.go index 8ed0654f..2864c472 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -161,9 +161,10 @@ func loadConfig(logger logger.Logger) (config.Config, error) { } func connectToMQTTBroker(mqttURL, thingID, thingKey string, logger logger.Logger) paho.Client { + clientID := fmt.Sprintf("agent-%s", thingID) opts := paho.NewClientOptions() opts.AddBroker(mqttURL) - opts.SetClientID("agent") + opts.SetClientID(clientID) opts.SetUsername(thingID) opts.SetPassword(thingKey) opts.SetCleanSession(true) diff --git a/deployments/Dockerfile b/deployments/Dockerfile deleted file mode 100644 index 97ebba0c..00000000 --- a/deployments/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM golang:1.13-alpine AS builder -ARG SVC -ARG GOARCH -ARG GOARM - -WORKDIR /go/src/github.com/mainflux/mainflux -COPY . . -RUN apk update \ - && apk add make\ - && make $SVC \ - && mv build/mainflux-$SVC /exe - -FROM scratch -# Certificates are needed so that mailing util can work. -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=builder /exe / -ENTRYPOINT ["/exe"]