blob: a562fdce658af820a0e523c5abe4c18ff4792f87 [file] [log] [blame]
Benjamin Copelande2772152020-06-17 11:54:56 +01001FROM ubuntu:bionic
2
Fathi Boudrae2361132020-11-10 19:30:58 +01003# Environment variables used by CI scripts
Riku Voipiob8578a82021-08-24 13:55:38 +03004ENV ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org
Fathi Boudrae2361132020-11-10 19:30:58 +01005ENV DOCKER_PREFIX=987685672616.dkr.ecr.us-east-1.amazonaws.com
Riku Voipiob8578a82021-08-24 13:55:38 +03006ENV LICENSE_VARIABLE=ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org
Fathi Boudrae2361132020-11-10 19:30:58 +01007
Benjamin Copelande2772152020-06-17 11:54:56 +01008ENV DEBIAN_FRONTEND=noninteractive
Fathi Boudra0a2e8002020-11-10 19:10:30 +01009ENV TOOLS_DIR=/home/buildslave/tools
10ENV PATH=${TOOLS_DIR}/bin:${PATH}
Benjamin Copelande2772152020-06-17 11:54:56 +010011ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar
Xinyu Zhang4987d4c2022-01-13 18:51:33 +080012ENV 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 ARMCLANG_6_13_DIR=${COMPILER_DIR}/armclang-6-13
18ENV ARMCLANG_6_13_PATH=${ARMCLANG_6_13_DIR}/bin
Benjamin Copelande2772152020-06-17 11:54:56 +010019ENV PKG_DEPS="\
Mate Toth-Pal4e6f1012020-07-07 10:13:07 +020020 bison \
Benjamin Copelande2772152020-06-17 11:54:56 +010021 build-essential \
Leonardo Sandoval23c34d12020-10-15 12:20:59 -050022 clang-tools-6.0 \
Benjamin Copelande2772152020-06-17 11:54:56 +010023 curl \
24 default-jre \
25 device-tree-compiler \
26 doxygen \
Karl Zhangedefe662020-09-15 18:12:19 +080027 exuberant-ctags \
Mate Toth-Pal4e6f1012020-07-07 10:13:07 +020028 flex \
Benjamin Copeland08f7e242020-06-30 13:38:41 +010029 g++-multilib \
30 gcc-multilib \
Benjamin Copelande2772152020-06-17 11:54:56 +010031 git \
32 graphviz \
33 jq \
Karl Zhangedefe662020-09-15 18:12:19 +080034 lcov \
Benjamin Copelande2772152020-06-17 11:54:56 +010035 libffi-dev \
Summer Qin14d6bf72021-06-23 14:06:02 +080036 librsvg2-bin \
Benjamin Copelande2772152020-06-17 11:54:56 +010037 libssl-dev \
Leonardo Sandoval04851952020-10-15 12:05:12 -050038 libxml-libxml-perl \
Fathi Boudra8cd1ff62021-01-21 15:51:45 +010039 locales \
Xinyu Zhang2c723782022-01-11 15:35:04 +080040 ninja-build \
Benjamin Copelande2772152020-06-17 11:54:56 +010041 openjdk-8-jdk \
42 openssh-server \
43 perl \
44 python \
45 python-psutil \
46 python3 \
47 python3-crypto \
48 python3-dev \
Benjamin Copelande2772152020-06-17 11:54:56 +010049 python3-pyasn1 \
50 srecord \
51 sudo \
52 tree \
53 unzip \
54 virtualenv \
55 wget \
56 zip \
57"
58
59# Can be overriden at build time
60ARG BUILDSLAVE_PASSWORD=buildslave
Benjamin Copelande2772152020-06-17 11:54:56 +010061
62COPY requirements_*.txt /opt/
Fathi Boudra0a2e8002020-11-10 19:10:30 +010063COPY tf-*.install /tmp/
Benjamin Copelandf7991f22020-07-30 14:01:21 +010064COPY setup-sshd /usr/sbin/setup-sshd
Benjamin Copelande2772152020-06-17 11:54:56 +010065
Fathi Boudra0a2e8002020-11-10 19:10:30 +010066RUN set -e ;\
Fathi Boudra8cd1ff62021-01-21 15:51:45 +010067 echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\
68 echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010069 apt update -q=2 ;\
70 apt dist-upgrade -q=2 --yes ;\
71 apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
72 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\
73 apt update -q=2 ;\
74 apt install -q=2 --yes --no-install-recommends git-lfs ;\
75 # Install Python requirements
Arthur She5bf67462021-03-11 22:59:11 -080076 curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010077 python2 /tmp/get-pip.py ;\
78 pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\
79 python3 /tmp/get-pip.py ;\
80 pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
81 # Set Python 3 as default
82 ln -s -f /usr/bin/python3 /usr/bin/python ;\
83 # Setup buildslave user for Jenkins
84 useradd -m -s /bin/bash buildslave ;\
85 echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\
86 echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\
87 chmod 0440 /etc/sudoers.d/jenkins ;\
Xinyu Zhang4987d4c2022-01-13 18:51:33 +080088 mkdir -p /var/run/sshd ${TOOLS_DIR} ${COMPILER_DIR};\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010089 # Run shell script(s) to install files, toolchains, etc...
90 bash -ex /tmp/tf-dependencies.install ;\
Fathi Boudraafdf3d42020-11-20 14:14:48 +010091 bash -ex /tmp/tf-environment.install ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010092 # Fix permissions
Xinyu Zhang4987d4c2022-01-13 18:51:33 +080093 chown -R buildslave:buildslave ${TOOLS_DIR} ${COMPILER_DIR} /usr/share/plantuml ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010094 # Cleanup
95 apt clean ;\
96 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Leonardo Sandoval7c2a7f42020-08-27 11:31:34 -050097
Fathi Boudra0c3d4c72020-12-17 12:33:43 +010098USER buildslave
99
100RUN set -e ;\
101 # Set git default config
102 git config --global user.email "ci@trustedfirmware.org" ;\
103 git config --global user.name "TF CI" ;\
104 git config --global color.ui "auto"
105
106USER root
107
Benjamin Copelandf7991f22020-07-30 14:01:21 +0100108EXPOSE 22
109ENTRYPOINT ["/usr/sbin/setup-sshd"]
Riku Voipio03ffb3c2021-09-30 19:20:22 +0300110