diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2018-04-02 13:55:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 13:55:12 -0700 |
commit | 4274e6af2d40553434fe4525f316415b98152d92 (patch) | |
tree | 808d2a80ea10f6a5880530a55411b410f671f611 /protoc-artifacts | |
parent | c934d1d185bd6aff0d2c6fc9a557de7a76ffe2fa (diff) | |
parent | cdbfdd8da86be37e9150f55982c291f4a02e2ecb (diff) | |
download | protobuf-4274e6af2d40553434fe4525f316415b98152d92.tar.gz protobuf-4274e6af2d40553434fe4525f316415b98152d92.tar.bz2 protobuf-4274e6af2d40553434fe4525f316415b98152d92.zip |
Merge pull request #4447 from ejona86/cleaner-protoc-artifacts
Cleaner protoc artifacts
Diffstat (limited to 'protoc-artifacts')
-rw-r--r-- | protoc-artifacts/Dockerfile | 22 | ||||
-rw-r--r-- | protoc-artifacts/README.md | 8 | ||||
-rwxr-xr-x | protoc-artifacts/scl-enable-devtoolset.sh | 13 |
3 files changed, 32 insertions, 11 deletions
diff --git a/protoc-artifacts/Dockerfile b/protoc-artifacts/Dockerfile index 43e6863c..c346586b 100644 --- a/protoc-artifacts/Dockerfile +++ b/protoc-artifacts/Dockerfile @@ -11,7 +11,9 @@ RUN yum install -y git \ libtool \ glibc-static.i686 \ glibc-devel \ - glibc-devel.i686 + glibc-devel.i686 \ + && \ + yum clean all # Install Java 8 RUN wget -q --no-cookies --no-check-certificate \ @@ -27,15 +29,17 @@ RUN wget -q http://apache.cs.utah.edu/maven/maven-3/3.3.9/binaries/apache-maven- ENV PATH /var/local/apache-maven-3.3.9/bin:$PATH # Install GCC 4.7 to support -static-libstdc++ -RUN wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo -P /etc/yum.repos.d -RUN bash -c 'echo "enabled=1" >> /etc/yum.repos.d/devtools-1.1.repo' -RUN bash -c "sed -e 's/\$basearch/i386/g' /etc/yum.repos.d/devtools-1.1.repo > /etc/yum.repos.d/devtools-i386-1.1.repo" -RUN sed -e 's/testing-/testing-i386-/g' -i /etc/yum.repos.d/devtools-i386-1.1.repo -RUN rpm --rebuilddb && yum install -y devtoolset-1.1 \ +RUN wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo -P /etc/yum.repos.d && \ + bash -c 'echo "enabled=1" >> /etc/yum.repos.d/devtools-1.1.repo' && \ + bash -c "sed -e 's/\$basearch/i386/g' /etc/yum.repos.d/devtools-1.1.repo > /etc/yum.repos.d/devtools-i386-1.1.repo" && \ + sed -e 's/testing-/testing-i386-/g' -i /etc/yum.repos.d/devtools-i386-1.1.repo && \ + rpm --rebuilddb && \ + yum install -y devtoolset-1.1 \ devtoolset-1.1-libstdc++-devel \ - devtoolset-1.1-libstdc++-devel.i686 + devtoolset-1.1-libstdc++-devel.i686 && \ + yum clean all -RUN git clone --depth 1 https://github.com/google/protobuf.git +COPY scl-enable-devtoolset.sh /var/local/ # Start in devtoolset environment that uses GCC 4.7 -CMD ["scl", "enable", "devtoolset-1.1", "bash"] +ENTRYPOINT ["/var/local/scl-enable-devtoolset.sh"] diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index ba3ca018..dcaec987 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -140,10 +140,14 @@ $ docker build -t protoc-artifacts . To run the image: ``` -$ docker run -it --rm=true protoc-artifacts +$ docker run -it --rm=true protoc-artifacts bash ``` -The Protobuf repository has been cloned into ``/protobuf``. +To checkout protobuf (run within the container): +``` +$ # Replace v3.5.1 with the version you want +$ wget -O - https://github.com/google/protobuf/archive/v3.5.1.tar.gz | tar xvzp +``` ### Tips for deploying on Windows Under Windows the following error may occur: ``gpg: cannot open tty `no tty': diff --git a/protoc-artifacts/scl-enable-devtoolset.sh b/protoc-artifacts/scl-enable-devtoolset.sh new file mode 100755 index 00000000..8d9585ea --- /dev/null +++ b/protoc-artifacts/scl-enable-devtoolset.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -eu -o pipefail + +quote() { + local arg + for arg in "$@"; do + printf "'" + printf "%s" "$arg" | sed -e "s/'/'\\\\''/g" + printf "' " + done +} + +exec scl enable devtoolset-1.1 "$(quote "$@")" |