From 81f35281aca13b62cef10e952dcefbfaeb8b2fa5 Mon Sep 17 00:00:00 2001 From: Aryan-sharma11 Date: Mon, 20 Jan 2025 16:19:00 +0530 Subject: [PATCH] fix empty.proto not found Signed-off-by: Aryan-sharma11 --- Dockerfile | 8 +++++--- protobuf/Makefile | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d961791f9..70b78adf2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,14 +14,16 @@ COPY . . WORKDIR /usr/src/KubeArmor/KubeArmor -RUN go install github.com/golang/protobuf/protoc-gen-go@latest +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 apk add curl +RUN mkdir -p /usr/local/include/google/protobuf && \ + curl -L https://raw.githubusercontent.com/protocolbuffers/protobuf/main/src/google/protobuf/empty.proto \ + -o /usr/local/include/google/protobuf/empty.proto RUN make - WORKDIR /usr/src/KubeArmor/BPF -RUN apk add curl # install bpftool RUN arch=$(uname -m) bpftool_version=v7.3.0 && \ if [[ "$arch" == "aarch64" ]]; then \ diff --git a/protobuf/Makefile b/protobuf/Makefile index 2474cef5cb..409ed8dd17 100644 --- a/protobuf/Makefile +++ b/protobuf/Makefile @@ -14,7 +14,7 @@ go.sum: go.mod %.pb.go: %.proto go mod tidy - protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative,require_unimplemented_servers=false $< + protoc -I/usr/local/include -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative,require_unimplemented_servers=false $< sed -i -e 's/\bPPID,omitempty\b/PPID,/' -e 's/\bUID,omitempty\b/UID,/' kubearmor.pb.go .PHONY: clean