diff --git a/Dockerfile b/Dockerfile index 9653af9..e845b87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,12 +26,12 @@ ENV GO111MODULE=on \ GOOS=linux \ GOARCH=amd64 -# Get grpc -RUN go get google.golang.org/grpc +# Download dependencies +RUN go mod download # Install protoc-gen-go -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest -RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0 +RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 # Copy the source and generate the .proto file ADD . /go/src/github.com/casbin/casbin-server @@ -40,9 +40,6 @@ RUN protoc --go_out=. --go_opt=paths=source_relative \ --go-grpc_out=. --go-grpc_opt=require_unimplemented_servers=false \ --go-grpc_opt=paths=source_relative proto/casbin.proto -# Download dependencies -RUN go mod download - # Install app RUN go install .