blob: 4bc1e647071cb6e4efef552c0986d2b20fa6c904 [file] [log] [blame]
Paul Sokolovskyeb8ca082024-03-06 21:43:56 +07001FROM ubuntu:jammy
2
3# Environment variables used by CI scripts
4ENV ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org
5ENV DOCKER_PREFIX=987685672616.dkr.ecr.us-east-1.amazonaws.com
6ENV LICENSE_VARIABLE=ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org
7
8ENV DEBIAN_FRONTEND=noninteractive
9ENV TOOLS_DIR=/home/buildslave/tools
10ENV PATH=${TOOLS_DIR}/bin:${PATH}
11ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar
12ENV COMPILER_DIR=/home/buildslave/compiler
13ENV GCC_7_3_1_DIR=${COMPILER_DIR}/gcc-7-3-1
14ENV GCC_7_3_1_PATH=${GCC_7_3_1_DIR}/bin
15ENV GCC_10_3_DIR=${COMPILER_DIR}/gcc-10-3
16ENV GCC_10_3_PATH=${GCC_10_3_DIR}/bin
17ENV GCC_11_2_DIR=${COMPILER_DIR}/gcc-11-2
18ENV GCC_11_2_PATH=${GCC_11_2_DIR}/bin
19ENV ARMCLANG_6_20_DIR=${COMPILER_DIR}/armclang-6-20
20ENV ARMCLANG_6_20_PATH=${ARMCLANG_6_20_DIR}/bin
21ENV ARMCLANG_6_21_DIR=${COMPILER_DIR}/armclang-6-21
22ENV ARMCLANG_6_21_PATH=${ARMCLANG_6_21_DIR}/bin
23ENV PKG_DEPS="\
24 bison \
25 build-essential \
26 clang-tools \
27 curl \
28 default-jre \
29 device-tree-compiler \
30 doxygen \
31 exuberant-ctags \
32 flex \
33 g++-multilib \
34 gcc-multilib \
35 gdisk \
36 git \
37 graphviz \
38 jq \
39 ninja-build \
40 lcov \
41 libffi-dev \
42 librsvg2-bin \
43 libssl-dev \
44 libxml-libxml-perl \
45 locales \
46 openjdk-11-jre-headless \
47 openssh-server \
48 perl \
49 python3 \
50 python3-pycryptodome \
51 python3-dev \
52 python3-psutil \
53 python3-pyasn1 \
54 python3-venv \
55 python2.7 \
56 srecord \
57 sudo \
58 tree \
59 unzip \
60 uuid-runtime \
61 virtualenv \
62 wget \
63 zip \
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 mkdir -p /var/run/sshd ${TOOLS_DIR} ${COMPILER_DIR};\
101 # Run shell script(s) to install files, toolchains, etc...
102 bash -ex /tmp/tf-dependencies.install ;\
103 bash -ex /tmp/tf-environment.install ;\
104 # Fix permissions
105 chown -R buildslave:buildslave ${TOOLS_DIR} ${COMPILER_DIR} /usr/share/plantuml ;\
106 # Cleanup
107 apt clean ;\
108 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
109
110USER buildslave
111
112RUN set -e ;\
113 # Set git default config
114 git config --global user.email "ci@trustedfirmware.org" ;\
115 git config --global user.name "TF CI" ;\
116 git config --global color.ui "auto"
117
118USER root
119
120EXPOSE 22
121ENTRYPOINT ["/usr/sbin/setup-sshd"]