Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 1 | FROM ubuntu:bionic |
| 2 | |
Fathi Boudra | e236113 | 2020-11-10 19:30:58 +0100 | [diff] [blame] | 3 | # Environment variables used by CI scripts |
Riku Voipio | b8578a8 | 2021-08-24 13:55:38 +0300 | [diff] [blame] | 4 | ENV ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org |
Fathi Boudra | e236113 | 2020-11-10 19:30:58 +0100 | [diff] [blame] | 5 | ENV DOCKER_PREFIX=987685672616.dkr.ecr.us-east-1.amazonaws.com |
Riku Voipio | b8578a8 | 2021-08-24 13:55:38 +0300 | [diff] [blame] | 6 | ENV LICENSE_VARIABLE=ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org |
Fathi Boudra | e236113 | 2020-11-10 19:30:58 +0100 | [diff] [blame] | 7 | |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 8 | ENV DEBIAN_FRONTEND=noninteractive |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 9 | ENV TOOLS_DIR=/home/buildslave/tools |
| 10 | ENV PATH=${TOOLS_DIR}/bin:${PATH} |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 11 | ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar |
Xinyu Zhang | 4987d4c | 2022-01-13 18:51:33 +0800 | [diff] [blame] | 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 |
Xinyu Zhang | 44ea583 | 2022-04-02 14:51:45 +0800 | [diff] [blame] | 17 | ENV GCC_11_2_DIR=${COMPILER_DIR}/gcc-11-2 |
| 18 | ENV GCC_11_2_PATH=${GCC_11_2_DIR}/bin |
Xinyu Zhang | 4987d4c | 2022-01-13 18:51:33 +0800 | [diff] [blame] | 19 | ENV ARMCLANG_6_13_DIR=${COMPILER_DIR}/armclang-6-13 |
| 20 | ENV ARMCLANG_6_13_PATH=${ARMCLANG_6_13_DIR}/bin |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 21 | ENV PKG_DEPS="\ |
Mate Toth-Pal | 4e6f101 | 2020-07-07 10:13:07 +0200 | [diff] [blame] | 22 | bison \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 23 | build-essential \ |
Leonardo Sandoval | 23c34d1 | 2020-10-15 12:20:59 -0500 | [diff] [blame] | 24 | clang-tools-6.0 \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 25 | curl \ |
| 26 | default-jre \ |
| 27 | device-tree-compiler \ |
| 28 | doxygen \ |
Karl Zhang | edefe66 | 2020-09-15 18:12:19 +0800 | [diff] [blame] | 29 | exuberant-ctags \ |
Mate Toth-Pal | 4e6f101 | 2020-07-07 10:13:07 +0200 | [diff] [blame] | 30 | flex \ |
Benjamin Copeland | 08f7e24 | 2020-06-30 13:38:41 +0100 | [diff] [blame] | 31 | g++-multilib \ |
| 32 | gcc-multilib \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 33 | git \ |
| 34 | graphviz \ |
| 35 | jq \ |
Karl Zhang | edefe66 | 2020-09-15 18:12:19 +0800 | [diff] [blame] | 36 | lcov \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 37 | libffi-dev \ |
Summer Qin | 14d6bf7 | 2021-06-23 14:06:02 +0800 | [diff] [blame] | 38 | librsvg2-bin \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 39 | libssl-dev \ |
Leonardo Sandoval | 0485195 | 2020-10-15 12:05:12 -0500 | [diff] [blame] | 40 | libxml-libxml-perl \ |
Fathi Boudra | 8cd1ff6 | 2021-01-21 15:51:45 +0100 | [diff] [blame] | 41 | locales \ |
Xinyu Zhang | 2c72378 | 2022-01-11 15:35:04 +0800 | [diff] [blame] | 42 | ninja-build \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 43 | openjdk-8-jdk \ |
| 44 | openssh-server \ |
| 45 | perl \ |
| 46 | python \ |
| 47 | python-psutil \ |
| 48 | python3 \ |
| 49 | python3-crypto \ |
| 50 | python3-dev \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 51 | python3-pyasn1 \ |
| 52 | srecord \ |
| 53 | sudo \ |
| 54 | tree \ |
| 55 | unzip \ |
| 56 | virtualenv \ |
| 57 | wget \ |
| 58 | zip \ |
| 59 | " |
| 60 | |
| 61 | # Can be overriden at build time |
| 62 | ARG BUILDSLAVE_PASSWORD=buildslave |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 63 | |
| 64 | COPY requirements_*.txt /opt/ |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 65 | COPY tf-*.install /tmp/ |
Benjamin Copeland | f7991f2 | 2020-07-30 14:01:21 +0100 | [diff] [blame] | 66 | COPY setup-sshd /usr/sbin/setup-sshd |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 67 | |
Paul Sokolovsky | eac0e03 | 2022-11-15 19:22:43 +0300 | [diff] [blame^] | 68 | RUN set -ex ;\ |
Fathi Boudra | 8cd1ff6 | 2021-01-21 15:51:45 +0100 | [diff] [blame] | 69 | echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\ |
| 70 | echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\ |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 71 | apt update -q=2 ;\ |
| 72 | apt dist-upgrade -q=2 --yes ;\ |
| 73 | apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\ |
| 74 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\ |
| 75 | apt update -q=2 ;\ |
| 76 | apt install -q=2 --yes --no-install-recommends git-lfs ;\ |
| 77 | # Install Python requirements |
Arthur She | 5bf6746 | 2021-03-11 22:59:11 -0800 | [diff] [blame] | 78 | curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\ |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 79 | python2 /tmp/get-pip.py ;\ |
| 80 | pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\ |
| 81 | python3 /tmp/get-pip.py ;\ |
| 82 | pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\ |
| 83 | # Set Python 3 as default |
| 84 | ln -s -f /usr/bin/python3 /usr/bin/python ;\ |
| 85 | # Setup buildslave user for Jenkins |
| 86 | useradd -m -s /bin/bash buildslave ;\ |
| 87 | echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
| 88 | echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
| 89 | chmod 0440 /etc/sudoers.d/jenkins ;\ |
Xinyu Zhang | 4987d4c | 2022-01-13 18:51:33 +0800 | [diff] [blame] | 90 | mkdir -p /var/run/sshd ${TOOLS_DIR} ${COMPILER_DIR};\ |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 91 | # Run shell script(s) to install files, toolchains, etc... |
| 92 | bash -ex /tmp/tf-dependencies.install ;\ |
Fathi Boudra | afdf3d4 | 2020-11-20 14:14:48 +0100 | [diff] [blame] | 93 | bash -ex /tmp/tf-environment.install ;\ |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 94 | # Fix permissions |
Xinyu Zhang | 4987d4c | 2022-01-13 18:51:33 +0800 | [diff] [blame] | 95 | chown -R buildslave:buildslave ${TOOLS_DIR} ${COMPILER_DIR} /usr/share/plantuml ;\ |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 96 | # Cleanup |
| 97 | apt clean ;\ |
| 98 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
Leonardo Sandoval | 7c2a7f4 | 2020-08-27 11:31:34 -0500 | [diff] [blame] | 99 | |
Fathi Boudra | 0c3d4c7 | 2020-12-17 12:33:43 +0100 | [diff] [blame] | 100 | USER buildslave |
| 101 | |
| 102 | RUN set -e ;\ |
| 103 | # Set git default config |
| 104 | git config --global user.email "ci@trustedfirmware.org" ;\ |
| 105 | git config --global user.name "TF CI" ;\ |
| 106 | git config --global color.ui "auto" |
| 107 | |
| 108 | USER root |
| 109 | |
Benjamin Copeland | f7991f2 | 2020-07-30 14:01:21 +0100 | [diff] [blame] | 110 | EXPOSE 22 |
| 111 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |
Riku Voipio | 03ffb3c | 2021-09-30 19:20:22 +0300 | [diff] [blame] | 112 | |