blob: 79315acca70f307962c255227e005e60c9747516 [file] [log] [blame]
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
ENV TOOLS_DIR=/home/buildslave/tools
ENV PATH=${TOOLS_DIR}/bin:${PATH}
ENV PKG_DEPS="\
bc \
bison \
build-essential \
cpio \
curl \
cmake \
openjdk-17-jdk \
flex \
git \
libglib2.0-0 \
libpixman-1-0 \
libsdl2-2.0-0 \
libssl-dev \
openssh-server \
python \
python3 \
python3-serial \
python3-distutils \
strace \
sudo \
wget \
device-tree-compiler \
ninja-build \
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
RUN set -ex ;\
apt update -q=2 ;\
apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
# Install Python requirements
curl --connect-timeout 5 --retry 5 --retry-delay 2 -sS https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\
python3 /tmp/get-pip.py ;\
pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
# Set Python 3 as default
ln -s -f /usr/bin/python3 /usr/bin/python ;\
# 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 ;\
mkdir -p /var/run/sshd ${TOOLS_DIR} ;\
# Install Arm GCC toolchain (aarch64-none-elf)
curl --connect-timeout 5 --retry 8 --retry-delay 2 --create-dirs -fsSLo /tmp/gcc-arm-x86_64-aarch64-none-elf.tar.xz \
https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar.xz ;\
tar -Jxf /tmp/gcc-arm-x86_64-aarch64-none-elf.tar.xz -C ${TOOLS_DIR} --strip-components=1 ;\
# Install LLVM Clang toolchain
curl --connect-timeout 5 --retry 8 --retry-delay 2 --create-dirs -fsSLo /tmp/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz \
https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz; \
tar -xf /tmp/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz -C ${TOOLS_DIR} --strip-components=1; \
# Setup environment for sshd
bash -ex /tmp/tf-environment.install ;\
# Fix permissions
chown -R buildslave:buildslave ${TOOLS_DIR} ;\
# Cleanup
apt clean ;\
rm -rf /var/lib/apt/lists/* /tmp/*
EXPOSE 22
ENTRYPOINT ["/usr/sbin/setup-sshd"]