diff --git a/.dockerignore b/.dockerignore index d000809eae..b3f074fa2d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -25,8 +25,8 @@ makefiles Makefile Makefile.local -bazel -WORKSPACE +#bazel +#WORKSPACE docs Dependencies.txt diff --git a/bazel/README.md b/bazel/README.md new file mode 100644 index 0000000000..cdba8cd852 --- /dev/null +++ b/bazel/README.md @@ -0,0 +1,6 @@ +# Docker file for testing + +# Bazel Test +```sh +docker build -t bazel -f bazel.Dockerfile .. +``` diff --git a/bazel/bazel.Dockerfile b/bazel/bazel.Dockerfile new file mode 100644 index 0000000000..299adc6b61 --- /dev/null +++ b/bazel/bazel.Dockerfile @@ -0,0 +1,30 @@ +# Create a virtual environment with all tools installed +# ref: https://hub.docker.com/_/ubuntu +FROM ubuntu:rolling AS env +LABEL maintainer="mizux.dev@gmail.com" +# Install system build dependencies +RUN apt-get update -qq \ +&& apt-get install -yq git wget curl libssl-dev build-essential \ +&& apt-get install -yq python3-dev python3-pip \ +&& apt-get install -yq default-jdk \ +&& apt-get clean \ +&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +# Install Bazel +RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add - +RUN echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list +RUN apt-get update -qq \ +&& apt-get install -yq bazel \ +&& apt-get clean \ +&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +CMD [ "/bin/bash" ] + +# Create lib directory +WORKDIR /home/lib +# Bundle lib source +COPY . . + +FROM env as build +RUN bazel build --curses=no --copt='-Wno-sign-compare' //...:all + +FROM build as test +RUN bazel test -c opt --curses=no --copt='-Wno-sign-compare' //...:all