Dockerfile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. # This is a base Dockerfile to use for self-containing local or remote development environments
  8. #
  9. # Once docker is installed, build a local image with this command:
  10. # `docker build /localDockerfilepath -t ubuntu-build:latest`
  11. #
  12. # To build using a local repo on disk, run this command:
  13. # `docker run -it -v /localo3depath:/data/workspace/o3de -v /localbuildpath:/data/workspace/o3de/build -v /local3rdPartypath:/root/.o3de/3rdParty \
  14. # --name build-o3de -d ubuntu-build:latest /bin/sh -c 'cd /data/workspace/o3de && python/python.sh -u scripts/build/ci_build.py --platform Linux --type profile'`
  15. #
  16. # Attach to the running build to interact or view logs using this command:
  17. # `docker attach build-o3de`
  18. FROM ubuntu:20.04
  19. WORKDIR /data/workspace
  20. # Initilize apt cache
  21. RUN apt-get clean && apt-get update
  22. # Setup time zone and locale data (necessary for SSL and HTTPS packages)
  23. RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration
  24. RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
  25. dpkg-reconfigure --frontend=noninteractive locales && \
  26. update-locale LANG=en_US.UTF-8
  27. ENV LANG=en_US.UTF-8
  28. # Install common tools
  29. RUN apt-get -y install tar sudo less vim lsof firewalld net-tools pciutils \
  30. file wget kmod xz-utils ca-certificates binutils kbd \
  31. python3-pip bind9-utils jq bc unzip git git-lfs lsb-release \
  32. software-properties-common
  33. # Install build and development tools
  34. RUN git clone --no-checkout https://github.com/o3de/o3de.git .o3de && \
  35. cd .o3de && \
  36. git sparse-checkout init --cone && \
  37. git sparse-checkout set scripts/build/build_node && \
  38. cd scripts/build/build_node/Platform/Linux && \
  39. ./install-ubuntu.sh
  40. # Install supported version of cmake if build tool installation runs into issues
  41. ENV CMAKE_VER=3.21.1-0kitware1ubuntu20.04.1
  42. RUN $(cmake --version) || apt-get -y install cmake=${CMAKE_VER} cmake-data=${CMAKE_VER}
  43. # Symlink clang version to non-versioned clang and set cc to clang
  44. RUN find /usr/bin/ -name clang* | sed -E 's/^(\/usr\/bin\/.*)(\-[0-9]*)$/ln -s -v \1\2 \1/' | xargs -d '\n' -n 1 bash -c && \
  45. update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \
  46. update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100