blob: de4647a75f37e039af26b686d8004208d963db51 [file] [log] [blame]
J-Alvesdee797e2024-07-31 18:01:06 +01001FROM ubuntu:jammy
2
3# Environment variables used by CI scripts
4ENV DEBIAN_FRONTEND=noninteractive
5ENV TOOLS_DIR=/home/buildslave/tools
6ENV RUSTUP_HOME=/usr/local/rustup
7ENV CARGO_HOME=/usr/local/cargo
8ENV PATH=${RUSTUP_HOME}/bin:${CARGO_HOME}/bin:${TOOLS_DIR}/bin:${PATH}
9ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar
10ENV PKG_DEPS="\
11 bc \
12 bison \
13 build-essential \
14 clang \
15 llvm \
16 clang-tools \
17 cpio \
18 curl \
Saheer Babub720c802025-07-23 09:01:16 +010019 openjdk-17-jre \
J-Alvesdee797e2024-07-31 18:01:06 +010020 device-tree-compiler \
21 doxygen \
22 expect \
23 exuberant-ctags \
24 file \
25 flex \
26 g++-multilib \
27 gcc-multilib \
28 gdisk \
29 git \
30 gnuplot \
31 golang-go \
32 graphviz \
33 jq \
34 ninja-build \
35 gn \
36 device-tree-compiler \
37 lcov \
38 libffi-dev \
39 libyaml-dev \
40 libxml-libxml-perl \
41 lld \
42 locales \
Saheer Babub720c802025-07-23 09:01:16 +010043 openjdk-17-jre-headless \
J-Alvesdee797e2024-07-31 18:01:06 +010044 openssh-server \
45 perl \
46 python3 \
47 python3-pycryptodome \
48 python3-dev \
49 python3-git \
50 python3-psutil \
51 python3-pyasn1 \
52 python3-venv \
53 python2.7 \
54 srecord \
55 sudo \
56 tree \
57 unzip \
58 util-linux \
59 uuid-runtime \
60 virtualenv \
61 wget \
62 zip \
63 libncurses5 \
64"
65
66# Can be overriden at build time
67ARG BUILDSLAVE_PASSWORD=buildslave
68
69COPY requirements_*.txt /opt/
70COPY tf-*.install /tmp/
71COPY setup-sshd /usr/sbin/setup-sshd
72
73# Copy armclang toolchains
74COPY ARMCompiler*.tar.gz /tmp/
75
76RUN set -ex ;\
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
111RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
Matthew Maurerd881a5b2025-07-23 22:55:06 +0000112 sh -s -- --default-toolchain stable -y && \
113 rustup install nightly
J-Alvesdee797e2024-07-31 18:01:06 +0100114RUN cargo install 'tokei@12.1.*'
115
116ENV NVM_DIR="/home/buildslave/.nvm"
117ENV BASH_ENV="${NVM_DIR}/nvm.sh"
118
119RUN echo "BASH_ENV=${BASH_ENV}" >> /etc/environment
120RUN echo "NVM_DIR=${NVM_DIR}" >> /etc/environment
121
122USER buildslave
123
124RUN curl -s "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh" | bash
125RUN bash -c "nvm install 14"
126
127USER root
128
129EXPOSE 22
130ENTRYPOINT ["/usr/sbin/setup-sshd"]