title: How to make bazel generate temporary static libs when bazel build //
body: <p>I'm using bazel to build tensorflow and tensorflow/serving, usually when I built tensorflow/serving with bazel, bazel generated some static library in <code>bazel-bin/tensorflow_serving/core/</code> for me.
  for example, after I successfully built tensorflow/serving, I got <code>bazel-bin/tensorflow_serving/core/libaspired_version_policy.a</code> and so on.</p>
  <p>But things changed when building tensorflow/serving on another docker instance, under <code>bazel-bin/tensorflow_serving/core/</code> I only got <code>_objs</code>, no static libraries anymore, how come?</p>
  <p>What should I do to get these static libraries?</p>
  <p>Here is my Dockerfile:</p>
  <pre><code>FROM tensorflow/tensorflow:1.15.5-py3
  LABEL version=&quot;1.0.0&quot;
  WORKDIR /root/
  ENV TMP=/tmp
  RUN export https_proxy=http://220.181.102.178:8118 &amp;&amp; \
    export http_proxy=http://220.181.102.178:8118
  RUN ln -s /usr/local/bin/gfortran /usr/bin/gfortran
  RUN apt-get update -yq ; exit 0
  RUN apt-get install -yq software-properties-common apt-utils &amp;&amp; apt-get update -yq; exit 0
  RUN apt-get install -yq vim tree clang gdb make git
  RUN apt-get install -yq automake bison flex libboost-all-dev libevent-dev
  RUN apt-get install -yq libssl-dev ssh libtool pkg-config
  RUN apt-get install -yq default-jdk default-jre libunwind8-dev libc-ares-dev
  RUN apt-get install -yq python-numpy python-future libleveldb-dev libsnappy-dev libgoogle-perftools-dev
  RUN apt-get install -yq librdkafka-dev libapr1-dev libaprutil1-dev texinfo unzip zip
  RUN unset TF_NEED_CUDA
  ## To install go, uncomment below
  #RUN add-apt-repository ppa:longsleep/golang-backports -y
  #RUN apt-get install -yq golang-go 
  RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y
  RUN apt-get install -yq gcc-8 g++-8
  RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 \
        --slave /usr/bin/g++ g++ /usr/bin/g++-8 \
        --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-8 \
        --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-8 \
        --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-8
  RUN export https_proxy=http://220.181.102.178:8118 &amp;&amp; wget https://github.com/Kitware/CMake/releases/download/v3.18.5/cmake-3.18.5-Linux-x86_64.sh &amp;&amp; \
      bash cmake-3.18.5-Linux-x86_64.sh --prefix=/usr/ --skip-license &amp;&amp; \
      rm -rf cmake-3.18.5-Linux-x86_64.sh
  RUN export https_proxy=http://220.181.102.178:8118 &amp;&amp; wget https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh &amp;&amp; \
      bash bazel-0.24.1-installer-linux-x86_64.sh &amp;&amp; rm -rf bazel-0.24.1-installer-linux-x86_64.sh
  RUN mkdir .ssh/
  ADD .ssh/ .ssh/
  ADD .vimrc .
  ADD .bashrc .
  RUN export PATH=/usr/local/cuda/bin:$PATH &amp;&amp; export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
  RUN git config --global credential.helper store
  </code></pre>
  <p>bazel version : 0.24.1</p>
  <p>tensorflow/serving version : 1.15.0 downloaded from github release page.</p>
  <p>build command :</p>
  <pre><code>export https_proxy=http://10.130.48.179:3128
  unset TF_NEED_CUDA
  
  # Build tensorflow_model_server
  bazel build -c opt --copt=-msse4.1 --copt=-msse4.2 --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-O3 --copt=-march=native --cxxopt=&quot;-fexceptions&quot; --verbose_failures //tensorflow_serving/model_servers:tensorflow_model_server
  </code></pre>
  <p>Please help. thanks.</p>