Add support for Protoc in workspace

This commit is contained in:
abler98
2020-09-04 19:03:23 +03:00
parent ade6f6b1a7
commit a3b451b408
3 changed files with 25 additions and 0 deletions

View File

@ -1376,6 +1376,27 @@ RUN if [ ${INSTALL_XMLRPC} = true ]; then \
docker-php-ext-install xmlrpc \
;fi
###########################################################################
# Protoc:
###########################################################################
ARG INSTALL_PROTOC=false
ARG PROTOC_VERSION
RUN if [ ${INSTALL_PROTOC} = true ]; then \
if [ ${PROTOC_VERSION} = "latest" ]; then \
REAL_PROTOC_VERSION=$(curl -s https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | \
sed -nr 's/.*"tag_name":\s?"v(.+?)".*/\1/p'); \
else \
REAL_PROTOC_VERSION=${PROTOC_VERSION}; \
fi && \
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} && \
unzip -q -o /tmp/protoc.zip -d /usr/local bin/protoc && \
unzip -q -o /tmp/protoc.zip -d /usr/local 'include/*' && \
rm -f /tmp/protoc.zip \
;fi
###########################################################################
# Check PHP version:
###########################################################################