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