Fix protoc install

This commit is contained in:
erikn69 2022-12-21 14:50:19 -05:00
parent ea1a91e9e1
commit e8432157b4

View File

@ -1527,6 +1527,7 @@ ARG INSTALL_PROTOC=false
ARG PROTOC_VERSION ARG PROTOC_VERSION
RUN if [ ${INSTALL_PROTOC} = true ]; then \ RUN if [ ${INSTALL_PROTOC} = true ]; then \
apt-get -yqq install sudo wget unzip && \
if [ ${PROTOC_VERSION} = "latest" ]; then \ if [ ${PROTOC_VERSION} = "latest" ]; then \
REAL_PROTOC_VERSION=$(curl -s https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | \ REAL_PROTOC_VERSION=$(curl -s https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | \
sed -nr 's/.*"tag_name":\s?"v(.+?)".*/\1/p'); \ sed -nr 's/.*"tag_name":\s?"v(.+?)".*/\1/p'); \
@ -1534,10 +1535,10 @@ RUN if [ ${INSTALL_PROTOC} = true ]; then \
REAL_PROTOC_VERSION=${PROTOC_VERSION}; \ REAL_PROTOC_VERSION=${PROTOC_VERSION}; \
fi && \ fi && \
PROTOC_ZIP=protoc-${REAL_PROTOC_VERSION}-linux-x86_64.zip; \ PROTOC_ZIP=protoc-${REAL_PROTOC_VERSION}-linux-x86_64.zip; \
curl -L -o /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v${REAL_PROTOC_VERSION}/${PROTOC_ZIP} && \ wget https://github.com/protocolbuffers/protobuf/releases/download/v${REAL_PROTOC_VERSION}/${PROTOC_ZIP} && \
unzip -q -o /tmp/protoc.zip -d /usr/local bin/protoc && \ unzip -q -o ${PROTOC_ZIP} -d /usr/local bin/protoc && \
unzip -q -o /tmp/protoc.zip -d /usr/local 'include/*' && \ unzip -q -o ${PROTOC_ZIP} -d /usr/local 'include/*' && \
rm -f /tmp/protoc.zip && \ rm -f ${PROTOC_ZIP} && \
chmod +x /usr/local/bin/protoc && \ chmod +x /usr/local/bin/protoc && \
chmod -R +r /usr/local/include/google \ chmod -R +r /usr/local/include/google \
;fi ;fi