blob: bf8ca1db71f8102cb4d225fb987b01c54762a3db [file] [log] [blame]
Kelley Spoon76bcaed2022-04-29 00:11:35 -05001FROM ubuntu:jammy
2
3# Environment variables used by CI scripts
4ENV DEBIAN_FRONTEND=noninteractive
Kelley Spoon76bcaed2022-04-29 00:11:35 -05005ENV TOOLS_DIR=/home/buildslave/tools
Chris Kay25a5a822022-08-24 12:32:30 +01006ENV RUSTUP_HOME=/usr/local/rustup
7ENV CARGO_HOME=/usr/local/cargo
8ENV PATH=${RUSTUP_HOME}/bin:${CARGO_HOME}/bin:${TOOLS_DIR}/bin:${PATH}
Kelley Spoon76bcaed2022-04-29 00:11:35 -05009ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar
10ENV PKG_DEPS="\
11 bc \
12 bison \
13 build-essential \
Boyan Karatotev55e400e2023-01-24 15:02:00 +000014 clang \
Boyan Karatotev7c1b88b2023-02-03 11:19:39 +000015 llvm \
Kelley Spoon76bcaed2022-04-29 00:11:35 -050016 clang-tools \
17 cpio \
18 curl \
19 default-jre \
20 device-tree-compiler \
21 doxygen \
Paul Sokolovskyb7c69592023-02-15 08:50:38 +070022 expect \
Kelley Spoon76bcaed2022-04-29 00:11:35 -050023 exuberant-ctags \
24 file \
25 flex \
26 g++-multilib \
27 gcc-multilib \
28 gdisk \
29 git \
30 gnuplot \
31 graphviz \
32 jq \
33 lcov \
34 libffi-dev \
35 libyaml-dev \
36 libxml-libxml-perl \
37 lld \
38 locales \
Paul Sokolovskyb1878942022-12-14 15:58:18 +030039 openjdk-11-jre-headless \
Kelley Spoon76bcaed2022-04-29 00:11:35 -050040 openssh-server \
41 perl \
42 python3 \
43 python3-pycryptodome \
44 python3-dev \
45 python3-psutil \
46 python3-pyasn1 \
47 python3-venv \
48 python2.7 \
49 srecord \
50 sudo \
51 tree \
52 unzip \
53 util-linux \
54 uuid-runtime \
55 virtualenv \
56 wget \
57 zip \
58"
59
60# Can be overriden at build time
61ARG BUILDSLAVE_PASSWORD=buildslave
62
63COPY requirements_*.txt /opt/
64COPY tf-*.install /tmp/
65COPY setup-sshd /usr/sbin/setup-sshd
66
Paul Sokolovsky86e18d42022-11-20 23:19:43 +030067# Copy armclang toolchains
68COPY DS500-BN-00026-r5p0-11rel0.tar.gz /tmp/
Boyan Karatotevca3afeb2023-01-24 14:58:41 +000069COPY DS500-BN-00026-r5p0-19rel0.tar.gz /tmp/
Paul Sokolovsky86e18d42022-11-20 23:19:43 +030070
Paul Sokolovsky06beab32022-11-15 19:21:08 +030071RUN set -ex ;\
Kelley Spoon76bcaed2022-04-29 00:11:35 -050072 echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\
73 echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\
74 # Set Python 3 as default
75 ln -s -f /usr/bin/python3 /usr/bin/python ;\
76 # Set symlink for python2 if not present
77 [ -L /usr/bin/python2 ] || ln -s /usr/bin/python2.7 /usr/bin/python2;\
78 apt update -q=2 ;\
79 apt dist-upgrade -q=2 --yes ;\
80 apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
81 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\
82 apt update -q=2 ;\
83 apt install -q=2 --yes --no-install-recommends git-lfs ;\
84 # Install Python requirements
85 curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\
86 python2 /tmp/get-pip.py ;\
87 pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\
88 python3 /tmp/get-pip.py ;\
89 pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
90 # Setup buildslave user for Jenkins
91 useradd -m -s /bin/bash buildslave ;\
92 echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\
93 echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\
94 chmod 0440 /etc/sudoers.d/jenkins ;\
95 # FIXME: add /arm as a temporary workaround until ARM CI moves to Open CI paths
96 mkdir -p /var/run/sshd ${TOOLS_DIR} /arm ;\
97 # Run shell script(s) to install files, toolchains, etc...
98 bash -ex /tmp/tf-dependencies.install ;\
99 bash -ex /tmp/tf-environment.install ;\
100 # Fix permissions
101 chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml /nfs/downloads/linaro /arm ;\
102 # Cleanup
103 apt clean ;\
104 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
105
Chris Kay25a5a822022-08-24 12:32:30 +0100106RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
107 sh -s -- --default-toolchain stable -y
Chris Kay00caca02022-08-25 11:37:24 +0100108RUN cargo install 'tokei@12.1.*'
Chris Kay25a5a822022-08-24 12:32:30 +0100109
Chris Kayde72f462022-10-12 14:03:08 +0100110ENV NVM_DIR="/home/buildslave/.nvm"
111ENV BASH_ENV="${NVM_DIR}/nvm.sh"
112
113RUN echo "BASH_ENV=${BASH_ENV}" >> /etc/environment
114RUN echo "NVM_DIR=${NVM_DIR}" >> /etc/environment
115
116USER buildslave
117
118RUN curl -s "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh" | bash
119RUN bash -c "nvm install 14"
120
121USER root
122
Kelley Spoon76bcaed2022-04-29 00:11:35 -0500123EXPOSE 22
124ENTRYPOINT ["/usr/sbin/setup-sshd"]