diff --git a/docker/master/Dockerfile b/docker/master/Dockerfile index bc8c93134..a1f67e406 100644 --- a/docker/master/Dockerfile +++ b/docker/master/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:stretch-slim +FROM debian:stretch-slim AS compilator LABEL maintainer "Infer team" @@ -22,6 +22,7 @@ RUN apt-get update && \ make \ openjdk-8-jdk-headless \ patch \ + patchelf \ pkg-config \ python2.7 \ unzip \ @@ -38,7 +39,7 @@ RUN curl -sL https://github.com/ocaml/opam/releases/download/2.0.3/opam-2.0.3-x8 # Disable sandboxing # Without this opam fails to compile OCaml for some reason. We don't need sandboxing inside a Docker container anyway. -RUN opam init --reinit --bare --disable-sandboxing +RUN opam init --reinit --bare --disable-sandboxing --yes --auto-setup # Download the latest Infer master RUN cd / && \ @@ -54,20 +55,27 @@ RUN cd /infer && \ ./configure && \ ./facebook-clang-plugins/clang/setup.sh -# Hackish for now: pull to get the latest version -RUN cd /infer && git pull +# Generate a release +RUN cd /infer && \ + make install-with-libs \ + BUILD_MODE=opt \ + PATCHELF=patchelf \ + DESTDIR="/infer-release" \ + libdir_relative_to_bindir="../lib" + +FROM debian:stretch-slim AS executor + +# Install python 2.7 since infer requires it to run +RUN apt-get update && apt-get install --yes --no-install-recommends \ + python2.7 + +# Get the infer release +COPY --from=compilator /infer-release/usr/local /infer + +# Installl infer +ENV PATH /infer/bin:${PATH} # if called with /infer-host mounted then copy infer there RUN if test -d /infer-host; then \ cp -av /infer/. /infer-host; \ fi - -# Install Infer -ENV INFER_HOME /infer/infer -ENV PATH ${INFER_HOME}/bin:${PATH} - -# build in non-optimized mode by default to speed up build times -ENV BUILD_MODE=default - -# prevent exiting by compulsively hitting Control-D -ENV IGNOREEOF=9