Dockerfile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 clean -y && \
  24. apt autoclean -y && \
  25. apt install -y -f && \
  26. apt autoremove -y && \
  27. apt-get update -y
  28. RUN apt-get install -y \
  29. dnsutils \
  30. nano
  31. # Set the locale
  32. RUN apt-get install -y locales
  33. RUN locale-gen en_US.UTF-8
  34. ENV LANG en_US.UTF-8
  35. ENV LANGUAGE en_US:en
  36. ENV LC_ALL en_US.UTF-8
  37. USER hpcc
  38. WORKDIR /hpcc-dev/HPCC-Platform
  39. # NB: PATCH_MD5 ensures cache miss (and therefore rebuild) if MD5 is different
  40. ARG PATCH_MD5
  41. COPY --chown=hpcc:hpcc hpcc.gitpatch .
  42. RUN if [ -s hpcc.gitpatch ]; then git apply --whitespace=nowarn hpcc.gitpatch; fi
  43. WORKDIR /hpcc-dev/build
  44. ARG BUILD_THREADS
  45. RUN if [ -n "${BUILD_THREADS}" ] ; then echo ${BUILD_THREADS} > ~/build_threads; else echo $(($(nproc)*3/2)) > ~/build_threads ; fi
  46. RUN echo Building with $(cat ~/build_threads) threads
  47. RUN make -j$(cat ~/build_threads)
  48. USER root
  49. RUN make -j$(cat ~hpcc/build_threads) install