Created
January 27, 2018 18:55
-
-
Save campoy/f6dd9bac10b80823362336fe79ca37f0 to your computer and use it in GitHub Desktop.
Building kythe in a Docker image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:jessie-backports | |
RUN apt-get update && apt-get install -y \ | |
asciidoc asciidoctor source-highlight graphviz \ | |
gcc libssl-dev uuid-dev libncurses-dev libcurl4-openssl-dev flex clang-3.5 bison \ | |
parallel | |
RUN apt-get install -y -t jessie-backports openjdk-8-jdk | |
# install golang | |
RUN apt-get install -y curl | |
ENV SHELL /bin/bash | |
RUN curl -LO https://get.golang.org/$(uname)/go_installer && chmod +x go_installer && ./go_installer && rm go_installer | |
# install docker | |
RUN apt-get install -y apt-transport-https | |
RUN curl -fsSL "https://download.docker.com/linux/debian/gpg" | apt-key add -qq - >/dev/null | |
RUN echo "deb [arch=amd64] https://download.docker.com/linux/debian jessie edge" > /etc/apt/sources.list.d/docker.list | |
RUN apt-get update -qq >/dev/null | |
RUN apt-get install -y -qq --no-install-recommends docker-ce >/dev/null | |
# install bazel | |
RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list | |
RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add - | |
RUN apt-get update && apt-get install -y bazel clang git build-essential pkg-config | |
# install CMake 3.10 (needs to be 3.4.3 or higher) | |
RUN curl -LO https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz && \ | |
tar -xzf cmake-3.10.2-Linux-x86_64.tar.gz && \ | |
mv cmake-3.10.2-Linux-x86_64 /usr/local/cmake && \ | |
ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake | |
# add all code and update dependencies | |
RUN git clone https://github.com/google/kythe.git | |
WORKDIR /kythe | |
RUN /kythe/tools/modules/update.sh | |
RUN bazel build //... | |
RUN bazel test //... | |
ENTRYPOINT ["/kythe/bazel-bin/kythe/go/serving/tools/kythe/linux_amd64_stripped/kythe"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment