2017-05-31 05:12:55 +02:00
|
|
|
FROM alpine:latest
|
2017-03-09 19:14:37 +01:00
|
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
2016-04-06 12:32:01 +02:00
|
|
|
|
2017-05-31 05:12:55 +02:00
|
|
|
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
|
|
|
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
2017-02-12 20:02:27 +01:00
|
|
|
ca-certificates \
|
2017-05-31 05:12:55 +02:00
|
|
|
openjdk8
|
2017-02-12 20:02:27 +01:00
|
|
|
|
2017-05-31 05:12:55 +02:00
|
|
|
# https://github.com/bazelbuild/bazel/releases
|
2018-05-11 16:35:18 +02:00
|
|
|
ENV BAZEL_VERSION 0.12.0
|
2017-05-31 05:12:55 +02:00
|
|
|
# https://gerrit.googlesource.com/gitiles/
|
|
|
|
ENV GITILES_VERSION v0.2-1
|
2017-02-12 19:25:18 +01:00
|
|
|
|
2017-05-31 05:12:55 +02:00
|
|
|
# install bazel
|
|
|
|
RUN set -x \
|
|
|
|
&& apk add --no-cache --virtual=.build-deps \
|
|
|
|
build-base \
|
2017-02-12 20:02:27 +01:00
|
|
|
curl \
|
2017-02-12 19:25:18 +01:00
|
|
|
git \
|
2017-05-31 05:12:55 +02:00
|
|
|
linux-headers \
|
|
|
|
python \
|
2017-02-12 20:02:27 +01:00
|
|
|
zip \
|
2017-05-31 05:12:55 +02:00
|
|
|
&& : install Bazel to build gitiles \
|
|
|
|
&& curl -sSL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip" -o /tmp/bazel.zip \
|
|
|
|
&& mkdir "/tmp/bazel-${BAZEL_VERSION}" \
|
|
|
|
&& unzip -qd "/tmp/bazel-${BAZEL_VERSION}" /tmp/bazel.zip \
|
|
|
|
&& rm -rf /tmp/bazel.zip \
|
|
|
|
&& ( \
|
|
|
|
cd "/tmp/bazel-${BAZEL_VERSION}" \
|
|
|
|
&& : add -fpermissive compiler option to avoid compilation failure \
|
|
|
|
&& sed -i -e '/"-std=c++0x"/{h;s//"-fpermissive"/;x;G}' tools/cpp/cc_configure.bzl \
|
|
|
|
&& : add '#include <sys/stat.h>' to avoid mode_t type error \
|
|
|
|
&& sed -i -e '/#endif \/\/ COMPILER_MSVC/{h;s//#else/;G;s//#include <sys\/stat.h>/;G;}' third_party/ijar/common.h \
|
|
|
|
&& bash compile.sh \
|
|
|
|
&& cp -p output/bazel /usr/bin/ \
|
|
|
|
) \
|
|
|
|
&& git clone --depth 1 --branch "${GITILES_VERSION}" https://gerrit.googlesource.com/gitiles /usr/src/gitiles \
|
2017-02-12 19:25:18 +01:00
|
|
|
&& ( \
|
|
|
|
cd /usr/src/gitiles \
|
2018-03-24 21:36:44 +01:00
|
|
|
&& bazel build --incompatible_disallow_uncalled_set_constructor=false gitiles-dev:dev \
|
2017-05-31 05:12:55 +02:00
|
|
|
&& cp -rL bazel-bin bin \
|
|
|
|
&& rm -rf bazel-bin \
|
2017-02-12 19:25:18 +01:00
|
|
|
) \
|
2017-05-31 05:12:55 +02:00
|
|
|
&& : clean up unneeded packages and files \
|
|
|
|
&& apk del .build-deps \
|
|
|
|
&& rm -rf /usr/bin/bazel /tmp/* /root/.cache "/tmp/bazel-${BAZEL_VERSION}"
|
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" ]
|