Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 1 | FROM ubuntu:jammy |
| 2 | |
| 3 | # Environment variables used by CI scripts |
| 4 | ENV DEBIAN_FRONTEND=noninteractive |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 5 | ENV TOOLS_DIR=/home/buildslave/tools |
Chris Kay | 25a5a82 | 2022-08-24 12:32:30 +0100 | [diff] [blame] | 6 | ENV RUSTUP_HOME=/usr/local/rustup |
| 7 | ENV CARGO_HOME=/usr/local/cargo |
| 8 | ENV PATH=${RUSTUP_HOME}/bin:${CARGO_HOME}/bin:${TOOLS_DIR}/bin:${PATH} |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 9 | ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar |
| 10 | ENV PKG_DEPS="\ |
| 11 | bc \ |
| 12 | bison \ |
| 13 | build-essential \ |
Boyan Karatotev | 7c1b88b | 2023-02-03 11:19:39 +0000 | [diff] [blame] | 14 | llvm \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 15 | clang-tools \ |
| 16 | cpio \ |
| 17 | curl \ |
| 18 | default-jre \ |
| 19 | device-tree-compiler \ |
| 20 | doxygen \ |
Paul Sokolovsky | b7c6959 | 2023-02-15 08:50:38 +0700 | [diff] [blame] | 21 | expect \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 22 | exuberant-ctags \ |
| 23 | file \ |
| 24 | flex \ |
| 25 | g++-multilib \ |
| 26 | gcc-multilib \ |
| 27 | gdisk \ |
| 28 | git \ |
| 29 | gnuplot \ |
Chris Kay | 38b498c | 2023-08-04 17:30:24 +0000 | [diff] [blame] | 30 | golang-go \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 31 | graphviz \ |
| 32 | jq \ |
J-Alves | 4ab2a21 | 2023-09-13 17:20:50 +0100 | [diff] [blame] | 33 | ninja-build \ |
| 34 | gn \ |
| 35 | device-tree-compiler \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 36 | lcov \ |
| 37 | libffi-dev \ |
| 38 | libyaml-dev \ |
| 39 | libxml-libxml-perl \ |
| 40 | lld \ |
| 41 | locales \ |
Paul Sokolovsky | b187894 | 2022-12-14 15:58:18 +0300 | [diff] [blame] | 42 | openjdk-11-jre-headless \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 43 | openssh-server \ |
| 44 | perl \ |
| 45 | python3 \ |
| 46 | python3-pycryptodome \ |
| 47 | python3-dev \ |
Arthur She | 74e6314 | 2024-03-11 14:29:11 -0700 | [diff] [blame] | 48 | python3-git \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 49 | python3-psutil \ |
| 50 | python3-pyasn1 \ |
| 51 | python3-venv \ |
| 52 | python2.7 \ |
Zachary Leaf | 8b50ab2 | 2024-09-10 11:36:06 +0100 | [diff] [blame] | 53 | qemu-system-arm \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 54 | srecord \ |
| 55 | sudo \ |
| 56 | tree \ |
| 57 | unzip \ |
| 58 | util-linux \ |
| 59 | uuid-runtime \ |
| 60 | virtualenv \ |
| 61 | wget \ |
| 62 | zip \ |
J-Alves | c2ffdd6 | 2024-08-01 13:44:42 +0100 | [diff] [blame] | 63 | libncurses5 \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 64 | " |
| 65 | |
| 66 | # Can be overriden at build time |
| 67 | ARG BUILDSLAVE_PASSWORD=buildslave |
| 68 | |
| 69 | COPY requirements_*.txt /opt/ |
| 70 | COPY tf-*.install /tmp/ |
| 71 | COPY setup-sshd /usr/sbin/setup-sshd |
| 72 | |
Paul Sokolovsky | 86e18d4 | 2022-11-20 23:19:43 +0300 | [diff] [blame] | 73 | # Copy armclang toolchains |
Paul Sokolovsky | 2282861 | 2023-10-11 21:06:15 +0300 | [diff] [blame] | 74 | COPY ARMCompiler*.tar.gz /tmp/ |
Paul Sokolovsky | 86e18d4 | 2022-11-20 23:19:43 +0300 | [diff] [blame] | 75 | |
Paul Sokolovsky | 06beab3 | 2022-11-15 19:21:08 +0300 | [diff] [blame] | 76 | RUN set -ex ;\ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 77 | echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\ |
| 78 | echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\ |
| 79 | # Set Python 3 as default |
| 80 | ln -s -f /usr/bin/python3 /usr/bin/python ;\ |
| 81 | # Set symlink for python2 if not present |
| 82 | [ -L /usr/bin/python2 ] || ln -s /usr/bin/python2.7 /usr/bin/python2;\ |
| 83 | apt update -q=2 ;\ |
| 84 | apt dist-upgrade -q=2 --yes ;\ |
| 85 | apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\ |
| 86 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\ |
| 87 | apt update -q=2 ;\ |
| 88 | apt install -q=2 --yes --no-install-recommends git-lfs ;\ |
| 89 | # Install Python requirements |
| 90 | curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\ |
| 91 | python2 /tmp/get-pip.py ;\ |
| 92 | pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\ |
| 93 | python3 /tmp/get-pip.py ;\ |
| 94 | pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\ |
| 95 | # Setup buildslave user for Jenkins |
| 96 | useradd -m -s /bin/bash buildslave ;\ |
| 97 | echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
| 98 | echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
| 99 | chmod 0440 /etc/sudoers.d/jenkins ;\ |
| 100 | # FIXME: add /arm as a temporary workaround until ARM CI moves to Open CI paths |
| 101 | mkdir -p /var/run/sshd ${TOOLS_DIR} /arm ;\ |
| 102 | # Run shell script(s) to install files, toolchains, etc... |
| 103 | bash -ex /tmp/tf-dependencies.install ;\ |
| 104 | bash -ex /tmp/tf-environment.install ;\ |
| 105 | # Fix permissions |
| 106 | chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml /nfs/downloads/linaro /arm ;\ |
| 107 | # Cleanup |
| 108 | apt clean ;\ |
| 109 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 110 | |
Chris Kay | 25a5a82 | 2022-08-24 12:32:30 +0100 | [diff] [blame] | 111 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ |
Tomás González | 3b16008 | 2025-04-08 13:55:08 +0100 | [diff] [blame] | 112 | sh -s -- --default-toolchain 1.85.0 -y |
Zachary Leaf | 8b50ab2 | 2024-09-10 11:36:06 +0100 | [diff] [blame] | 113 | RUN set -ex ;\ |
Tomás González | 85bfbbb | 2025-05-29 17:20:56 +0100 | [diff] [blame^] | 114 | cargo install --locked 'tokei@12.1.*' ;\ |
| 115 | cargo install --locked cargo-binutils ;\ |
Tomás González | 80ea5fc | 2025-04-30 18:03:24 +0100 | [diff] [blame] | 116 | cargo install --locked cargo-vet ;\ |
Olivier Deprez | 5b3d906 | 2024-12-03 10:37:47 +0100 | [diff] [blame] | 117 | rustup target add aarch64-unknown-none-softfloat ;\ |
Zachary Leaf | 164b09d | 2024-10-01 13:53:44 +0100 | [diff] [blame] | 118 | rustup component add llvm-tools rustfmt |
Chris Kay | 25a5a82 | 2022-08-24 12:32:30 +0100 | [diff] [blame] | 119 | |
Chris Kay | de72f46 | 2022-10-12 14:03:08 +0100 | [diff] [blame] | 120 | ENV NVM_DIR="/home/buildslave/.nvm" |
| 121 | ENV BASH_ENV="${NVM_DIR}/nvm.sh" |
| 122 | |
| 123 | RUN echo "BASH_ENV=${BASH_ENV}" >> /etc/environment |
| 124 | RUN echo "NVM_DIR=${NVM_DIR}" >> /etc/environment |
| 125 | |
| 126 | USER buildslave |
| 127 | |
| 128 | RUN curl -s "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh" | bash |
| 129 | RUN bash -c "nvm install 14" |
| 130 | |
| 131 | USER root |
| 132 | |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 133 | EXPOSE 22 |
| 134 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |