[SEBA-881] move device-management to go mod
Change-Id: Idf082ee75c157f72fd4173f653d9e13c1c55fcd3
diff --git a/Dockerfile b/Dockerfile
index dc26b04..8b63327 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,7 @@
RUN mkdir /app
COPY . /app/
WORKDIR /app
+ENV GO111MODULE=on
ENV PROTOC_VERSION 3.6.1
ENV PROTOC_SHA256SUM 6003de742ea3fcf703cfec1cd4a3380fd143081a2eb0e559065563496af27807
RUN apt-get update && apt-get install --no-install-recommends -y \
@@ -28,6 +29,7 @@
gcc=4:8.3.0-1 \
curl=7.64.0-4 \
unzip=6.0-23+deb10u1
+
RUN curl -L -o /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
RUN mkdir /tmp/protoc3
RUN echo "$PROTOC_SHA256SUM /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip" | sha256sum -c - \
@@ -38,15 +40,14 @@
&& go get "github.com/golang/protobuf/proto" \
&& go get -v "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" \
&& go get -v "github.com/golang/protobuf/protoc-gen-go" \
- && go get "github.com/Shopify/sarama" \
- && go get "github.com/Sirupsen/logrus"\
&& protoc -I proto -I"${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis" --go_out=plugins=grpc:proto/ proto/*.proto
-RUN CGO_ENABLED=0 GOOS=linux go build -o main .
+RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o main .
FROM alpine:3.9.4
WORKDIR /app/
COPY https-server.crt .
COPY https-server.key .
COPY --from=build-env /app/main .
+COPY --from=build-env /app/proto/importer.pb.go .
ENTRYPOINT ["./main"]