Skip to content

Instantly share code, notes, and snippets.

@smparkes
Created March 21, 2016 00:09
Show Gist options
  • Save smparkes/2840ef16bcf18e78961e to your computer and use it in GitHub Desktop.
Save smparkes/2840ef16bcf18e78961e to your computer and use it in GitHub Desktop.
docker build of protobuf with bazel
FROM ubuntu:15.10
RUN \
apt-get update && \
apt-get install --no-install-recommends -y openjdk-8-jre-headless && \
apt-get install --no-install-recommends -y gcc-4.9 && \
apt-get install --no-install-recommends -y g++-4.9 && \
apt-get install --no-install-recommends -y wget && \
apt-get install --no-install-recommends -y unzip && \
apt-get install --no-install-recommends -y openjdk-8-jdk && \
apt-get install --no-install-recommends -y git && \
apt-get install --no-install-recommends -y rsync && \
apt-get install --no-install-recommends -y less && \
apt-get clean && \
wget 'https://github.com/bazelbuild/bazel/releases/download/0.2.0/bazel-0.2.0-installer-linux-x86_64.sh' && \
bash bazel-0.2.0-installer-linux-x86_64.sh && \
ln -s /usr/bin/gcc-4.9 /usr/bin/gcc && \
ln -s /usr/bin/g++-4.9 /usr/bin/g++
RUN \
/bin/bash -c " \
export VERBOSE_BLAZE_CLIENT=1 && \
export HOSTNAME=unknown && \
cat /etc/hosts > hosts.tmp && \
sed -e s/`hostname`/ci/ < hosts.tmp > /etc/hosts && \
set -e && \
set -o pipefail && \
git clone https://github.com/google/protobuf.git && \
cd protobuf && \
bazel --batch build --genrule_strategy=standalone --spawn_strategy=standalone //:protobuf_lite | cat && \
bazel --batch build --genrule_strategy=standalone --spawn_strategy=standalone --check_up_to_date //:protobuf_lite | cat && \
true \
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment