github.com/khulnasoft/trivy@v0.48.1-0.20231207234930-27df843a75e0/Dockerfile.protoc (about)

     1  FROM --platform=linux/amd64 golang:1.21
     2  
     3  # Set environment variable for protoc
     4  ENV PROTOC_ZIP=protoc-3.19.4-linux-x86_64.zip
     5  
     6  # Install unzip for protoc installation and clean up cache
     7  RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
     8  
     9  # Download and install protoc
    10  RUN curl --retry 5 -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/$PROTOC_ZIP \
    11      && unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \
    12      && unzip -o $PROTOC_ZIP -d /usr/local 'include/*' \
    13      && rm -f $PROTOC_ZIP
    14  
    15  # Install Go tools
    16  RUN go install github.com/twitchtv/twirp/protoc-gen-twirp@v8.1.0
    17  RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
    18  RUN go install github.com/magefile/mage@v1.14.0
    19  
    20  ENV TRIVY_PROTOC_CONTAINER=true