File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
1
FROM --platform=linux/amd64 golang:1.19
2
2
3
- # Install protoc (cf. http://google.github.io/proto-lens/installing- protoc.html)
3
+ # Set environment variable for protoc
4
4
ENV PROTOC_ZIP=protoc-3.19.4-linux-x86_64.zip
5
- RUN apt-get update && apt-get install -y unzip
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
6
10
RUN curl --retry 5 -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/$PROTOC_ZIP \
7
11
&& unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \
8
- && unzip -o $PROTOC_ZIP -d /usr/local 'include/*' \
12
+ && unzip -o $PROTOC_ZIP -d /usr/local 'include/*' \
9
13
&& rm -f $PROTOC_ZIP
10
14
11
- RUN go install github.com/twitchtv/twirp/protoc-gen-twirp@v8.1.0
12
- RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
13
- RUN go install github.com/magefile/mage@v1.14.0
15
+ # Install Go tools
16
+ RUN go install \
17
+ github.com/twitchtv/twirp/protoc-gen-twirp@v8.1.0 \
18
+ google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1 \
19
+ github.com/magefile/mage@v1.14.0
14
20
15
21
ENV TRIVY_PROTOC_CONTAINER=true
You can’t perform that action at this time.
0 commit comments