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 | 55e400e | 2023-01-24 15:02:00 +0000 | [diff] [blame] | 14 | clang \ |
Boyan Karatotev | 7c1b88b | 2023-02-03 11:19:39 +0000 | [diff] [blame^] | 15 | llvm \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 16 | clang-tools \ |
| 17 | cpio \ |
| 18 | curl \ |
| 19 | default-jre \ |
| 20 | device-tree-compiler \ |
| 21 | doxygen \ |
| 22 | exuberant-ctags \ |
| 23 | file \ |
| 24 | flex \ |
| 25 | g++-multilib \ |
| 26 | gcc-multilib \ |
| 27 | gdisk \ |
| 28 | git \ |
| 29 | gnuplot \ |
| 30 | graphviz \ |
| 31 | jq \ |
| 32 | lcov \ |
| 33 | libffi-dev \ |
| 34 | libyaml-dev \ |
| 35 | libxml-libxml-perl \ |
| 36 | lld \ |
| 37 | locales \ |
Paul Sokolovsky | b187894 | 2022-12-14 15:58:18 +0300 | [diff] [blame] | 38 | openjdk-11-jre-headless \ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 39 | openssh-server \ |
| 40 | perl \ |
| 41 | python3 \ |
| 42 | python3-pycryptodome \ |
| 43 | python3-dev \ |
| 44 | python3-psutil \ |
| 45 | python3-pyasn1 \ |
| 46 | python3-venv \ |
| 47 | python2.7 \ |
| 48 | srecord \ |
| 49 | sudo \ |
| 50 | tree \ |
| 51 | unzip \ |
| 52 | util-linux \ |
| 53 | uuid-runtime \ |
| 54 | virtualenv \ |
| 55 | wget \ |
| 56 | zip \ |
| 57 | " |
| 58 | |
| 59 | # Can be overriden at build time |
| 60 | ARG BUILDSLAVE_PASSWORD=buildslave |
| 61 | |
| 62 | COPY requirements_*.txt /opt/ |
| 63 | COPY tf-*.install /tmp/ |
| 64 | COPY setup-sshd /usr/sbin/setup-sshd |
| 65 | |
Paul Sokolovsky | 86e18d4 | 2022-11-20 23:19:43 +0300 | [diff] [blame] | 66 | # Copy armclang toolchains |
| 67 | COPY DS500-BN-00026-r5p0-11rel0.tar.gz /tmp/ |
Boyan Karatotev | ca3afeb | 2023-01-24 14:58:41 +0000 | [diff] [blame] | 68 | COPY DS500-BN-00026-r5p0-19rel0.tar.gz /tmp/ |
Paul Sokolovsky | 86e18d4 | 2022-11-20 23:19:43 +0300 | [diff] [blame] | 69 | |
Paul Sokolovsky | 06beab3 | 2022-11-15 19:21:08 +0300 | [diff] [blame] | 70 | RUN set -ex ;\ |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 71 | echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\ |
| 72 | echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\ |
| 73 | # Set Python 3 as default |
| 74 | ln -s -f /usr/bin/python3 /usr/bin/python ;\ |
| 75 | # Set symlink for python2 if not present |
| 76 | [ -L /usr/bin/python2 ] || ln -s /usr/bin/python2.7 /usr/bin/python2;\ |
| 77 | apt update -q=2 ;\ |
| 78 | apt dist-upgrade -q=2 --yes ;\ |
| 79 | apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\ |
| 80 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\ |
| 81 | apt update -q=2 ;\ |
| 82 | apt install -q=2 --yes --no-install-recommends git-lfs ;\ |
| 83 | # Install Python requirements |
| 84 | curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\ |
| 85 | python2 /tmp/get-pip.py ;\ |
| 86 | pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\ |
| 87 | python3 /tmp/get-pip.py ;\ |
| 88 | pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\ |
| 89 | # Setup buildslave user for Jenkins |
| 90 | useradd -m -s /bin/bash buildslave ;\ |
| 91 | echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
| 92 | echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
| 93 | chmod 0440 /etc/sudoers.d/jenkins ;\ |
| 94 | # FIXME: add /arm as a temporary workaround until ARM CI moves to Open CI paths |
| 95 | mkdir -p /var/run/sshd ${TOOLS_DIR} /arm ;\ |
| 96 | # Run shell script(s) to install files, toolchains, etc... |
| 97 | bash -ex /tmp/tf-dependencies.install ;\ |
| 98 | bash -ex /tmp/tf-environment.install ;\ |
| 99 | # Fix permissions |
| 100 | chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml /nfs/downloads/linaro /arm ;\ |
| 101 | # Cleanup |
| 102 | apt clean ;\ |
| 103 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 104 | |
Chris Kay | 25a5a82 | 2022-08-24 12:32:30 +0100 | [diff] [blame] | 105 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ |
| 106 | sh -s -- --default-toolchain stable -y |
Chris Kay | 00caca0 | 2022-08-25 11:37:24 +0100 | [diff] [blame] | 107 | RUN cargo install 'tokei@12.1.*' |
Chris Kay | 25a5a82 | 2022-08-24 12:32:30 +0100 | [diff] [blame] | 108 | |
Chris Kay | de72f46 | 2022-10-12 14:03:08 +0100 | [diff] [blame] | 109 | ENV NVM_DIR="/home/buildslave/.nvm" |
| 110 | ENV BASH_ENV="${NVM_DIR}/nvm.sh" |
| 111 | |
| 112 | RUN echo "BASH_ENV=${BASH_ENV}" >> /etc/environment |
| 113 | RUN echo "NVM_DIR=${NVM_DIR}" >> /etc/environment |
| 114 | |
| 115 | USER buildslave |
| 116 | |
| 117 | RUN curl -s "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh" | bash |
| 118 | RUN bash -c "nvm install 14" |
| 119 | |
| 120 | USER root |
| 121 | |
Kelley Spoon | 76bcaed | 2022-04-29 00:11:35 -0500 | [diff] [blame] | 122 | EXPOSE 22 |
| 123 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |