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