2016-04-06 12:32:01 +02:00
|
|
|
FROM java:8-alpine
|
2016-09-20 00:25:05 +02:00
|
|
|
MAINTAINER Jessie Frazelle <jess@linux.com>
|
2016-04-06 12:32:01 +02:00
|
|
|
|
2017-02-12 19:25:18 +01:00
|
|
|
# install bazel
|
|
|
|
ENV BAZEL_VERSION 0.4.4
|
2016-04-06 19:21:51 +02:00
|
|
|
RUN buildDeps=' \
|
|
|
|
bash \
|
2017-02-12 19:25:18 +01:00
|
|
|
build-base \
|
2016-06-17 02:23:25 +02:00
|
|
|
curl \
|
2017-02-12 19:25:18 +01:00
|
|
|
gnupg \
|
|
|
|
linux-headers \
|
2016-04-06 19:21:51 +02:00
|
|
|
zip \
|
|
|
|
' \
|
|
|
|
set -x \
|
2016-06-06 05:40:20 +02:00
|
|
|
&& apk --no-cache add $buildDeps \
|
2017-02-12 19:25:18 +01:00
|
|
|
&& curl -sSL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip" -o "/tmp/bazel-${BAZEL_VERSION}-dist.zip" \
|
|
|
|
&& curl -sSL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip.sig" -o "/tmp/bazel-${BAZEL_VERSION}-dist.zip.sig" \
|
|
|
|
&& curl -sSL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip.sha256" -o "/tmp/bazel-${BAZEL_VERSION}-dist.zip.sha256" \
|
|
|
|
&& export GNUPGHOME="$(mktemp -d)" \
|
|
|
|
&& curl -sSL "https://bazel.build/bazel-release.pub.gpg" | gpg --no-tty --import \
|
|
|
|
&& gpg --batch --verify "/tmp/bazel-${BAZEL_VERSION}-dist.zip.sig" "/tmp/bazel-${BAZEL_VERSION}-dist.zip" \
|
2016-04-06 16:04:12 +02:00
|
|
|
&& ( \
|
2017-02-12 19:25:18 +01:00
|
|
|
cd /tmp \
|
|
|
|
&& cat "bazel-${BAZEL_VERSION}-dist.zip.sha256" | sha256sum -c - \
|
2016-04-06 16:04:12 +02:00
|
|
|
) \
|
2017-02-12 19:25:18 +01:00
|
|
|
&& rm -r "$GNUPGHOME" "/tmp/bazel-${BAZEL_VERSION}-dist.zip.sig" "/tmp/bazel-${BAZEL_VERSION}-dist.zip.sha256" \
|
|
|
|
&& mkdir -p /tmp/bazel \
|
|
|
|
&& unzip "/tmp/bazel-${BAZEL_VERSION}-dist.zip" -d /tmp/bazel \
|
|
|
|
&& rm "/tmp/bazel-${BAZEL_VERSION}-dist.zip" \
|
2016-04-06 16:04:12 +02:00
|
|
|
&& ( \
|
2017-02-12 19:25:18 +01:00
|
|
|
cd /tmp/bazel \
|
|
|
|
&& unset JAVA_VERSION \
|
|
|
|
&& bash ./compile.sh compile \
|
|
|
|
&& mv output/bazel /usr/bin/bazel \
|
2016-04-06 16:04:12 +02:00
|
|
|
) \
|
2016-04-06 19:21:51 +02:00
|
|
|
&& apk del $buildDeps \
|
2017-02-12 19:25:18 +01:00
|
|
|
&& rm -rf /tmp/bazel*
|
|
|
|
|
|
|
|
|
|
|
|
# install gitiles
|
|
|
|
RUN buildDeps=' \
|
|
|
|
git \
|
|
|
|
' \
|
|
|
|
set -x \
|
|
|
|
&& apk --no-cache add $buildDeps \
|
|
|
|
&& git clone --depth 1 --recurse-submodules https://gerrit.googlesource.com/gitiles /usr/src/gitiles \
|
|
|
|
&& ( \
|
|
|
|
cd /usr/src/gitiles \
|
|
|
|
&& git submodule update --init \
|
|
|
|
&& bazel build //... \
|
|
|
|
) \
|
|
|
|
&& apk del $buildDeps
|
2016-04-06 12:32:01 +02:00
|
|
|
|
2017-02-12 19:25:18 +01:00
|
|
|
COPY start.sh /usr/bin/start.sh
|
2016-04-06 12:32:01 +02:00
|
|
|
|
2017-02-12 19:25:18 +01:00
|
|
|
ENTRYPOINT [ "/usr/bin/start.sh" ]
|