Dockerfile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ##############################################################################
  2. #
  3. # HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. ##############################################################################
  17. # Build container image for a git commit, based on an earlier build
  18. # For use when developing/testing the system only
  19. # See incr.sh for how this is used
  20. ARG PREV_LABEL
  21. ARG DOCKER_REPO
  22. FROM ${DOCKER_REPO}/platform-build:${PREV_LABEL}
  23. RUN apt-get install -y \
  24. dnsutils \
  25. nano
  26. RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.17.0/bin/linux/amd64/kubectl && chmod +x ./kubectl && mv ./kubectl /usr/local/bin
  27. USER hpcc
  28. WORKDIR /hpcc-dev/HPCC-Platform
  29. # NB: PATCH_MD5 ensures cache miss (and therefore rebuild) if MD5 is different
  30. ARG PATCH_MD5
  31. COPY hpcc.gitpatch .
  32. RUN if [ -s hpcc.gitpatch ]; then git apply --whitespace=nowarn hpcc.gitpatch; fi
  33. WORKDIR /hpcc-dev/build
  34. ARG BUILD_THREADS
  35. RUN if [ -n "${BUILD_THREADS}" ] ; then echo ${BUILD_THREADS} > ~/build_threads; else echo $(($(nproc)*3/2)) > ~/build_threads ; fi
  36. RUN echo Building with $(cat ~/build_threads) threads
  37. RUN make -j$(cat ~/build_threads)
  38. USER root
  39. RUN make -j$(cat ~hpcc/build_threads) install