Dockerfile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. # Base container image that builds all HPCC platform components
  18. ARG BASE_VER=7.12
  19. FROM hpccsystems/platform-build-base:${BASE_VER}
  20. RUN groupadd -g 1000 hpcc
  21. RUN useradd -s /bin/bash -r -m -N -c "hpcc runtime User" -u 999 -g hpcc hpcc
  22. RUN passwd -l hpcc
  23. 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
  24. WORKDIR /hpcc-dev
  25. RUN chown hpcc:hpcc /hpcc-dev
  26. # Runs as hpcc to fetch sources and build, to aid debugging containers as user hpcc
  27. USER hpcc
  28. ARG BUILD_USER=hpcc-systems
  29. RUN echo BUILD_USER is ${BUILD_USER}
  30. RUN git clone https://github.com/${BUILD_USER}/HPCC-Platform.git && \
  31. cd HPCC-Platform && \
  32. git submodule update --init --recursive
  33. WORKDIR /hpcc-dev/HPCC-Platform
  34. ARG BUILD_TAG=none
  35. RUN git fetch origin && \
  36. git checkout ${BUILD_TAG} && \
  37. git submodule update --init --recursive
  38. WORKDIR /hpcc-dev
  39. RUN mkdir build
  40. WORKDIR /hpcc-dev/build
  41. ARG BUILD_TYPE=RelWithDebInfo
  42. ARG USE_CPPUNIT=1
  43. RUN cmake /hpcc-dev/HPCC-Platform -Wno-dev -DCONTAINERIZED=1 -DINCLUDE_PLUGINS=1 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUSE_PYTHON2=0 -DSUPPRESS_SPARK=1 -DUSE_CPPUNIT=${USE_CPPUNIT}
  44. ARG BUILD_THREADS
  45. RUN if [ -n "${BUILD_THREADS}" ] ; then echo ${BUILD_THREADS} > ~/build_threads; else echo $(nproc) > ~/build_threads ; fi
  46. RUN echo Building with $(cat ~/build_threads) threads
  47. RUN make -j$(cat ~/build_threads) jlib
  48. RUN make -j$(cat ~/build_threads) esp
  49. RUN make -j$(cat ~/build_threads) roxie
  50. RUN make -j$(cat ~/build_threads) ws_workunits ecl
  51. RUN make -j$(cat ~/build_threads)
  52. USER root
  53. RUN make -j$(cat ~hpcc/build_threads) install
  54. RUN mkdir /var/lib/HPCCSystems && chown hpcc:hpcc /var/lib/HPCCSystems
  55. RUN mkdir /var/log/HPCCSystems && chown hpcc:hpcc /var/log/HPCCSystems
  56. RUN mkdir /var/lock/HPCCSystems && chown hpcc:hpcc /var/lock/HPCCSystems
  57. RUN mkdir /var/run/HPCCSystems && chown hpcc:hpcc /var/run/HPCCSystems