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 |
| 5 | ENV NVM_DIR=/usr/local/nvm |
| 6 | ENV TOOLS_DIR=/home/buildslave/tools |
| 7 | ENV PATH=${TOOLS_DIR}/bin:${PATH} |
| 8 | ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar |
| 9 | ENV PKG_DEPS="\ |
| 10 | bc \ |
| 11 | bison \ |
| 12 | build-essential \ |
| 13 | clang-tools \ |
| 14 | cpio \ |
| 15 | curl \ |
| 16 | default-jre \ |
| 17 | device-tree-compiler \ |
| 18 | doxygen \ |
| 19 | exuberant-ctags \ |
| 20 | file \ |
| 21 | flex \ |
| 22 | g++-multilib \ |
| 23 | gcc-multilib \ |
| 24 | gdisk \ |
| 25 | git \ |
| 26 | gnuplot \ |
| 27 | graphviz \ |
| 28 | jq \ |
| 29 | lcov \ |
| 30 | libffi-dev \ |
| 31 | libyaml-dev \ |
| 32 | libxml-libxml-perl \ |
| 33 | lld \ |
| 34 | locales \ |
| 35 | openjdk-8-jdk \ |
| 36 | openssh-server \ |
| 37 | perl \ |
| 38 | python3 \ |
| 39 | python3-pycryptodome \ |
| 40 | python3-dev \ |
| 41 | python3-psutil \ |
| 42 | python3-pyasn1 \ |
| 43 | python3-venv \ |
| 44 | python2.7 \ |
| 45 | srecord \ |
| 46 | sudo \ |
| 47 | tree \ |
| 48 | unzip \ |
| 49 | util-linux \ |
| 50 | uuid-runtime \ |
| 51 | virtualenv \ |
| 52 | wget \ |
| 53 | zip \ |
| 54 | " |
| 55 | |
| 56 | # Can be overriden at build time |
| 57 | ARG BUILDSLAVE_PASSWORD=buildslave |
| 58 | |
| 59 | COPY requirements_*.txt /opt/ |
| 60 | COPY tf-*.install /tmp/ |
| 61 | COPY setup-sshd /usr/sbin/setup-sshd |
| 62 | |
| 63 | RUN set -e ;\ |
| 64 | echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\ |
| 65 | echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\ |
| 66 | # Set Python 3 as default |
| 67 | ln -s -f /usr/bin/python3 /usr/bin/python ;\ |
| 68 | # Set symlink for python2 if not present |
| 69 | [ -L /usr/bin/python2 ] || ln -s /usr/bin/python2.7 /usr/bin/python2;\ |
| 70 | apt update -q=2 ;\ |
| 71 | apt dist-upgrade -q=2 --yes ;\ |
| 72 | apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\ |
| 73 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\ |
| 74 | apt update -q=2 ;\ |
| 75 | apt install -q=2 --yes --no-install-recommends git-lfs ;\ |
| 76 | # Install Python requirements |
| 77 | curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\ |
| 78 | python2 /tmp/get-pip.py ;\ |
| 79 | pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\ |
| 80 | python3 /tmp/get-pip.py ;\ |
| 81 | pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\ |
| 82 | # Setup buildslave user for Jenkins |
| 83 | useradd -m -s /bin/bash buildslave ;\ |
| 84 | echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
| 85 | echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
| 86 | chmod 0440 /etc/sudoers.d/jenkins ;\ |
| 87 | # FIXME: add /arm as a temporary workaround until ARM CI moves to Open CI paths |
| 88 | mkdir -p /var/run/sshd ${TOOLS_DIR} /arm ;\ |
| 89 | # Run shell script(s) to install files, toolchains, etc... |
| 90 | bash -ex /tmp/tf-dependencies.install ;\ |
| 91 | bash -ex /tmp/tf-environment.install ;\ |
| 92 | # Fix permissions |
| 93 | chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml /nfs/downloads/linaro /arm ;\ |
| 94 | # Cleanup |
| 95 | apt clean ;\ |
| 96 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 97 | |
| 98 | EXPOSE 22 |
| 99 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |