-
Notifications
You must be signed in to change notification settings - Fork 851
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[protoc] Parameterize protoc version|architecture (#260)
* Parameterize protoc version|architecture * Revised README to include protoc compiler plugins
- Loading branch information
Showing
3 changed files
with
56 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
FROM ubuntu | ||
FROM ubuntu:19.10 | ||
|
||
ARG PROTOC_VERSION=3.6.1 | ||
ARG PROTOC_TARGET=linux-x86_64 | ||
ARG ASSET_NAME=protoc-${PROTOC_VERSION}-${PROTOC_TARGET}.zip | ||
ARG VERS=3.8.0 | ||
ARG ARCH=linux-x86_64 | ||
|
||
RUN apt-get -qy update && apt-get -qy install python wget unzip && rm -rf /var/lib/apt/lists/* | ||
RUN apt-get -qy update && \ | ||
apt-get -qy install wget unzip && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN echo "${PROTOC_VERSION}/${ASSET_NAME}" | ||
RUN echo "${VERS}-${ARCH}" | ||
|
||
RUN wget https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${PROTOC_TARGET}.zip && \ | ||
unzip ${ASSET_NAME} -d protoc && rm ${ASSET_NAME} | ||
RUN wget https://github.com/google/protobuf/releases/download/v${VERS}/protoc-${VERS}-${ARCH}.zip && \ | ||
unzip protoc-${VERS}-${ARCH}.zip -d protoc && \ | ||
rm protoc-${VERS}-${ARCH}.zip | ||
|
||
ENV PATH=$PATH:/protoc/bin/ | ||
ENTRYPOINT ["protoc"] | ||
CMD ["--help] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
substitutions: | ||
_VERS: "3.8.0" | ||
_ARCH: linux-x86_64 | ||
|
||
steps: | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: | ||
[ | ||
'build', | ||
'--tag', | ||
'gcr.io/$PROJECT_ID/protoc', | ||
'--cache-from', | ||
'gcr.io/$PROJECT_ID/protoc', | ||
'.', | ||
] | ||
images: ['gcr.io/$PROJECT_ID/protoc'] | ||
tags: ['cloud-builders-community'] | ||
- build | ||
- "--build-arg=VERS=${_VERS}" | ||
- "--build-arg=ARCH=${_ARCH}" | ||
- --tag=gcr.io/${PROJECT_ID}/protoc:${_VERS}-${_ARCH} | ||
- --tag=gcr.io/${PROJECT_ID}/protoc:3.8.0-linux-x86_64 | ||
- "." | ||
|
||
images: | ||
- "gcr.io/${PROJECT_ID}/protoc" | ||
|
||
tags: ['cloud-builders-community'] |