| FROM ubuntu:jammy |
| |
| # Environment variables used by CI scripts |
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV TOOLS_DIR=/home/buildslave/tools |
| ENV RUSTUP_HOME=/usr/local/rustup |
| ENV CARGO_HOME=/usr/local/cargo |
| ENV PATH=${RUSTUP_HOME}/bin:${CARGO_HOME}/bin:${TOOLS_DIR}/bin:${PATH} |
| ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar |
| ENV PKG_DEPS="\ |
| bc \ |
| bison \ |
| build-essential \ |
| llvm \ |
| clang-tools \ |
| cpio \ |
| curl \ |
| default-jre \ |
| device-tree-compiler \ |
| doxygen \ |
| expect \ |
| exuberant-ctags \ |
| file \ |
| flex \ |
| g++-multilib \ |
| gcc-multilib \ |
| gdisk \ |
| git \ |
| gnuplot \ |
| golang-go \ |
| graphviz \ |
| jq \ |
| ninja-build \ |
| gn \ |
| device-tree-compiler \ |
| lcov \ |
| libffi-dev \ |
| libyaml-dev \ |
| libxml-libxml-perl \ |
| lld \ |
| locales \ |
| openjdk-11-jre-headless \ |
| openssh-server \ |
| perl \ |
| python3 \ |
| python3-pycryptodome \ |
| python3-dev \ |
| python3-git \ |
| python3-psutil \ |
| python3-pyasn1 \ |
| python3-venv \ |
| python2.7 \ |
| qemu-system-arm \ |
| srecord \ |
| sudo \ |
| tree \ |
| unzip \ |
| util-linux \ |
| uuid-runtime \ |
| virtualenv \ |
| wget \ |
| zip \ |
| libncurses5 \ |
| " |
| |
| # Can be overriden at build time |
| ARG BUILDSLAVE_PASSWORD=buildslave |
| |
| COPY requirements_*.txt /opt/ |
| COPY tf-*.install /tmp/ |
| COPY setup-sshd /usr/sbin/setup-sshd |
| |
| # Copy armclang toolchains |
| COPY ARMCompiler*.tar.gz /tmp/ |
| |
| RUN set -ex ;\ |
| echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\ |
| echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\ |
| # Set Python 3 as default |
| ln -s -f /usr/bin/python3 /usr/bin/python ;\ |
| # Set symlink for python2 if not present |
| [ -L /usr/bin/python2 ] || ln -s /usr/bin/python2.7 /usr/bin/python2;\ |
| apt update -q=2 ;\ |
| apt dist-upgrade -q=2 --yes ;\ |
| apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\ |
| curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\ |
| apt update -q=2 ;\ |
| apt install -q=2 --yes --no-install-recommends git-lfs ;\ |
| # Install Python requirements |
| curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\ |
| python2 /tmp/get-pip.py ;\ |
| pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\ |
| python3 /tmp/get-pip.py ;\ |
| pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\ |
| # Setup buildslave user for Jenkins |
| useradd -m -s /bin/bash buildslave ;\ |
| echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
| echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
| chmod 0440 /etc/sudoers.d/jenkins ;\ |
| # FIXME: add /arm as a temporary workaround until ARM CI moves to Open CI paths |
| mkdir -p /var/run/sshd ${TOOLS_DIR} /arm ;\ |
| # Run shell script(s) to install files, toolchains, etc... |
| bash -ex /tmp/tf-dependencies.install ;\ |
| bash -ex /tmp/tf-environment.install ;\ |
| # Fix permissions |
| chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml /nfs/downloads/linaro /arm ;\ |
| # Cleanup |
| apt clean ;\ |
| rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| |
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ |
| sh -s -- --default-toolchain 1.85.0 -y |
| RUN set -ex ;\ |
| cargo install --locked 'tokei@12.1.*' ;\ |
| cargo install --locked cargo-binutils ;\ |
| cargo install --locked cargo-vet ;\ |
| rustup target add aarch64-unknown-none-softfloat ;\ |
| rustup component add llvm-tools rustfmt |
| |
| ENV NVM_DIR="/home/buildslave/.nvm" |
| ENV BASH_ENV="${NVM_DIR}/nvm.sh" |
| |
| RUN echo "BASH_ENV=${BASH_ENV}" >> /etc/environment |
| RUN echo "NVM_DIR=${NVM_DIR}" >> /etc/environment |
| |
| USER buildslave |
| |
| RUN curl -s "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh" | bash |
| RUN bash -c "nvm install 14" |
| |
| USER root |
| |
| EXPOSE 22 |
| ENTRYPOINT ["/usr/sbin/setup-sshd"] |