Dockerfile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Copyright (c) Contributors to the Open 3D Engine Project.
  2. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  3. #
  4. # SPDX-License-Identifier: Apache-2.0 OR MIT
  5. #
  6. # This docker file uses ubuntu 20.04 as the base image so that the AWS Native C++ libraries will use OpenSSL 3 as the base
  7. # for its dependencies
  8. #
  9. # The cpu architecture to base the docker base script from
  10. ARG INPUT_ARCHITECTURE=amd64
  11. # The root to base the docker script base from
  12. ARG INPUT_IMAGE=ubuntu:20.04
  13. ARG PYTHON_FOLDER_NAME
  14. ARG QT_FOLDER_NAME
  15. ARG DOCKER_BUILD_SCRIPT
  16. FROM ${INPUT_ARCHITECTURE}/${INPUT_IMAGE}
  17. ARG INPUT_ARCHITECTURE
  18. ARG INPUT_IMAGE
  19. ARG PYTHON_FOLDER_NAME
  20. ARG QT_FOLDER_NAME
  21. ARG DOCKER_BUILD_SCRIPT
  22. WORKDIR /data/workspace
  23. # Initilize apt cache
  24. RUN apt-get clean && apt-get update
  25. # Setup time zone and locale data (necessary for SSL and HTTPS packages)
  26. # RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration
  27. RUN apt-get -y install tzdata locales keyboard-configuration
  28. RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
  29. dpkg-reconfigure --frontend=noninteractive locales && \
  30. update-locale LANG=en_US.UTF-8
  31. ENV LANG=en_US.UTF-8
  32. # Install the development packages needed to build Qt from source
  33. RUN apt-get install -y cmake \
  34. build-essential \
  35. clang-12 \
  36. llvm-12 \
  37. git \
  38. libgl1-mesa-dev \
  39. libpcre2-dev \
  40. chrpath
  41. RUN apt-get install -y libclang-12-dev
  42. RUN apt upgrade -y
  43. # Prepare a target folder within the container to install the build artifacts tp
  44. RUN mkdir -p /data/workspace/build && \
  45. mkdir -p /data/workspace/src
  46. run git config --global --add safe.directory /data/workspace/src && \
  47. git config --global --add safe.directory /data/workspace/src/sources/pyside2-tools
  48. ENV PYTHON_FOLDER_NAME=${PYTHON_FOLDER_NAME}
  49. ENV QT_FOLDER_NAME=${QT_FOLDER_NAME}
  50. ENV LLVM_INSTALL_DIR=/usr/lib/llvm-12
  51. ENV LLVM_CONFIG=/usr/bin/llvm-config-12
  52. # The 3P package for python has some embedded paths from the host machine that was
  53. # used to build it, and pyside2 extracts these paths to deduce the include and lib
  54. # paths. To work around this and make it appear that the dependent 3P python package
  55. # was installed in this docker sctructure, we will instead create a symlink from the
  56. # 3p package's original path to the actual one mapped to the workspace path
  57. RUN if [ "${INPUT_ARCHITECTURE}" = "aarch64" ]; then \
  58. mkdir -p /home/ubuntu/github/3p-package-source/package-system/python/linux_aarch64/package && \
  59. cd /home/ubuntu/github/3p-package-source/package-system/python/linux_aarch64/package && \
  60. ln -s /data/workspace/${PYTHON_FOLDER_NAME}/python python; \
  61. else \
  62. mkdir -p /home/github/3p-package-source/package-system/python/linux_x64/package && \
  63. cd /home/github/3p-package-source/package-system/python/linux_x64/package && \
  64. ln -s /data/workspace/${PYTHON_FOLDER_NAME}/python python; \
  65. fi
  66. # Copy the build script specific to this Docker script in order to execute the build
  67. ARG CACHEBUST=1
  68. COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/
  69. COPY src /data/workspace/src/
  70. COPY ${PYTHON_FOLDER_NAME} /data/workspace/${PYTHON_FOLDER_NAME}/
  71. COPY ${QT_FOLDER_NAME} /data/workspace/${QT_FOLDER_NAME}/
  72. ENTRYPOINT ["/bin/bash"]