Nicola Mazzucato | 8ab727f | 2024-04-19 13:48:05 +0100 | [diff] [blame] | 1 | FROM ubuntu:jammy AS base |
Paul Sokolovsky | eb8ca08 | 2024-03-06 21:43:56 +0700 | [diff] [blame] | 2 | |
| 3 | # Environment variables used by CI scripts |
| 4 | ENV ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org |
| 5 | ENV DOCKER_PREFIX=987685672616.dkr.ecr.us-east-1.amazonaws.com |
| 6 | ENV LICENSE_VARIABLE=ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org |
| 7 | |
| 8 | ENV DEBIAN_FRONTEND=noninteractive |
| 9 | ENV TOOLS_DIR=/home/buildslave/tools |
| 10 | ENV PATH=${TOOLS_DIR}/bin:${PATH} |
| 11 | ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar |
| 12 | ENV COMPILER_DIR=/home/buildslave/compiler |
| 13 | ENV GCC_7_3_1_DIR=${COMPILER_DIR}/gcc-7-3-1 |
| 14 | ENV GCC_7_3_1_PATH=${GCC_7_3_1_DIR}/bin |
| 15 | ENV GCC_10_3_DIR=${COMPILER_DIR}/gcc-10-3 |
| 16 | ENV GCC_10_3_PATH=${GCC_10_3_DIR}/bin |
| 17 | ENV GCC_11_2_DIR=${COMPILER_DIR}/gcc-11-2 |
| 18 | ENV GCC_11_2_PATH=${GCC_11_2_DIR}/bin |
Nicola Mazzucato | e9095ce | 2024-05-20 10:52:22 +0100 | [diff] [blame] | 19 | ENV GCC_13_2_DIR=${COMPILER_DIR}/gcc-13-2 |
| 20 | ENV GCC_13_2_PATH=${GCC_13_2_DIR}/bin |
Paul Sokolovsky | eb8ca08 | 2024-03-06 21:43:56 +0700 | [diff] [blame] | 21 | ENV ARMCLANG_6_20_DIR=${COMPILER_DIR}/armclang-6-20 |
| 22 | ENV ARMCLANG_6_20_PATH=${ARMCLANG_6_20_DIR}/bin |
| 23 | ENV ARMCLANG_6_21_DIR=${COMPILER_DIR}/armclang-6-21 |
| 24 | ENV ARMCLANG_6_21_PATH=${ARMCLANG_6_21_DIR}/bin |
Matthew Dalzell | ac6bfb7 | 2025-06-09 15:45:24 +0100 | [diff] [blame^] | 25 | ENV CLANG_18_1_3_DIR=${COMPILER_DIR}/clang_18_1_3 |
| 26 | ENV CLANG_18_1_3_PATH=${CLANG_18_1_3_DIR}/bin |
Paul Sokolovsky | eb8ca08 | 2024-03-06 21:43:56 +0700 | [diff] [blame] | 27 | ENV PKG_DEPS="\ |
| 28 | bison \ |
| 29 | build-essential \ |
| 30 | clang-tools \ |
| 31 | curl \ |
| 32 | default-jre \ |
| 33 | device-tree-compiler \ |
| 34 | doxygen \ |
| 35 | exuberant-ctags \ |
| 36 | flex \ |
| 37 | g++-multilib \ |
| 38 | gcc-multilib \ |
| 39 | gdisk \ |
| 40 | git \ |
| 41 | graphviz \ |
| 42 | jq \ |
| 43 | ninja-build \ |
| 44 | lcov \ |
| 45 | libffi-dev \ |
| 46 | librsvg2-bin \ |
| 47 | libssl-dev \ |
| 48 | libxml-libxml-perl \ |
| 49 | locales \ |
| 50 | openjdk-11-jre-headless \ |
| 51 | openssh-server \ |
| 52 | perl \ |
| 53 | python3 \ |
| 54 | python3-pycryptodome \ |
| 55 | python3-dev \ |
| 56 | python3-psutil \ |
| 57 | python3-pyasn1 \ |
| 58 | python3-venv \ |
| 59 | python2.7 \ |
| 60 | srecord \ |
| 61 | sudo \ |
| 62 | tree \ |
| 63 | unzip \ |
| 64 | uuid-runtime \ |
| 65 | virtualenv \ |
| 66 | wget \ |
| 67 | zip \ |
| 68 | " |
| 69 | |
| 70 | # Can be overriden at build time |
| 71 | ARG BUILDSLAVE_PASSWORD=buildslave |
| 72 | |
| 73 | COPY requirements_*.txt /opt/ |
| 74 | COPY tf-*.install /tmp/ |
| 75 | COPY setup-sshd /usr/sbin/setup-sshd |
| 76 | |
| 77 | # Copy armclang toolchains |
| 78 | COPY ARMCompiler*.tar.gz /tmp/ |
| 79 | |
| 80 | RUN set -ex ;\ |
| 81 | echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\ |
| 82 | echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\ |
| 83 | # Set Python 3 as default |
| 84 | ln -s -f /usr/bin/python3 /usr/bin/python ;\ |
| 85 | # Set symlink for python2 if not present |
| 86 | [ -L /usr/bin/python2 ] || ln -s /usr/bin/python2.7 /usr/bin/python2;\ |
| 87 | apt update -q=2 ;\ |
| 88 | apt dist-upgrade -q=2 --yes ;\ |
| 89 | apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\ |
| 90 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\ |
| 91 | apt update -q=2 ;\ |
| 92 | apt install -q=2 --yes --no-install-recommends git-lfs ;\ |
| 93 | # Install Python requirements |
| 94 | curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\ |
| 95 | python2 /tmp/get-pip.py ;\ |
| 96 | pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\ |
| 97 | python3 /tmp/get-pip.py ;\ |
| 98 | pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\ |
| 99 | # Setup buildslave user for Jenkins |
| 100 | useradd -m -s /bin/bash buildslave ;\ |
| 101 | echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
| 102 | echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
| 103 | chmod 0440 /etc/sudoers.d/jenkins ;\ |
| 104 | mkdir -p /var/run/sshd ${TOOLS_DIR} ${COMPILER_DIR};\ |
| 105 | # Run shell script(s) to install files, toolchains, etc... |
| 106 | bash -ex /tmp/tf-dependencies.install ;\ |
| 107 | bash -ex /tmp/tf-environment.install ;\ |
| 108 | # Fix permissions |
| 109 | chown -R buildslave:buildslave ${TOOLS_DIR} ${COMPILER_DIR} /usr/share/plantuml ;\ |
| 110 | # Cleanup |
| 111 | apt clean ;\ |
| 112 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 113 | |
Nicola Mazzucato | 8ab727f | 2024-04-19 13:48:05 +0100 | [diff] [blame] | 114 | FROM base AS base-ci |
Paul Sokolovsky | eb8ca08 | 2024-03-06 21:43:56 +0700 | [diff] [blame] | 115 | USER buildslave |
| 116 | |
| 117 | RUN set -e ;\ |
| 118 | # Set git default config |
| 119 | git config --global user.email "ci@trustedfirmware.org" ;\ |
| 120 | git config --global user.name "TF CI" ;\ |
| 121 | git config --global color.ui "auto" |
| 122 | |
| 123 | USER root |
| 124 | |
| 125 | EXPOSE 22 |
| 126 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |
Nicola Mazzucato | 8ab727f | 2024-04-19 13:48:05 +0100 | [diff] [blame] | 127 | |
| 128 | FROM base AS base-local |
| 129 | ENV PATH="${PATH}:/home/buildslave/compiler/gcc-11-2/bin" |