Skip to content

Commit

Permalink
Add TARGETARCH dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
rimrakhimov committed Jan 22, 2024
1 parent 8090e2f commit 5efb255
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions docker/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@ ARG PROTOC_VERSION=25.2
ARG PROTOC_GEN_OPENAPIV2_VERSION=2.19.0

RUN apt-get update && apt-get install -y curl wget unzip
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip -O ./protoc.zip \
&& unzip protoc.zip \
&& mv ./include/* /usr/include/ \
&& mv ./bin/protoc /usr/bin/protoc

RUN wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v${PROTOC_GEN_OPENAPIV2_VERSION}/protoc-gen-openapiv2-v${PROTOC_GEN_OPENAPIV2_VERSION}-linux-x86_64 -O ./protoc-gen-openapiv2 \
&& chmod +x protoc-gen-openapiv2 \
&& mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2
ARG TARGETARCH
RUN case ${TARGETARCH} in \
"arm64") TARGETARCH=aarch_64 ;; \
"amd64") TARGETARCH=x86_64 ;; \
esac \
&& wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${TARGETARCH}.zip -O ./protoc.zip \
&& unzip protoc.zip \
&& mv ./include/* /usr/include/ \
&& mv ./bin/protoc /usr/bin/protoc \

RUN case ${TARGETARCH} in \
"amd64") TARGETARCH=x86_64 ;; \
esac \
&& wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v${PROTOC_GEN_OPENAPIV2_VERSION}/protoc-gen-openapiv2-v${PROTOC_GEN_OPENAPIV2_VERSION}-linux-${TARGETARCH} -O ./protoc-gen-openapiv2 \
&& chmod +x protoc-gen-openapiv2 \
&& mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2

WORKDIR /app

0 comments on commit 5efb255

Please sign in to comment.