blob: 92100a210507de841260528c72025e39a4206012 [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 \
Benjamin Copelande2772152020-06-17 11:54:56 +010040 openjdk-8-jdk \
41 openssh-server \
42 perl \
43 python \
44 python-psutil \
45 python3 \
46 python3-crypto \
47 python3-dev \
Benjamin Copelande2772152020-06-17 11:54:56 +010048 python3-pyasn1 \
49 srecord \
50 sudo \
51 tree \
52 unzip \
53 virtualenv \
54 wget \
55 zip \
56"
57
58# Can be overriden at build time
59ARG BUILDSLAVE_PASSWORD=buildslave
Benjamin Copelande2772152020-06-17 11:54:56 +010060
61COPY requirements_*.txt /opt/
Fathi Boudra0a2e8002020-11-10 19:10:30 +010062COPY tf-*.install /tmp/
Benjamin Copelandf7991f22020-07-30 14:01:21 +010063COPY setup-sshd /usr/sbin/setup-sshd
Benjamin Copelande2772152020-06-17 11:54:56 +010064
Fathi Boudra0a2e8002020-11-10 19:10:30 +010065RUN set -e ;\
Fathi Boudra8cd1ff62021-01-21 15:51:45 +010066 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 ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010068 apt update -q=2 ;\
69 apt dist-upgrade -q=2 --yes ;\
70 apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
71 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\
72 apt update -q=2 ;\
73 apt install -q=2 --yes --no-install-recommends git-lfs ;\
74 # Install Python requirements
Arthur She5bf67462021-03-11 22:59:11 -080075 curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010076 python2 /tmp/get-pip.py ;\
77 pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\
78 python3 /tmp/get-pip.py ;\
79 pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
80 # Set Python 3 as default
81 ln -s -f /usr/bin/python3 /usr/bin/python ;\
82 # Setup buildslave user for Jenkins
83 useradd -m -s /bin/bash buildslave ;\
84 echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\
85 echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\
86 chmod 0440 /etc/sudoers.d/jenkins ;\
Xinyu Zhang4987d4c2022-01-13 18:51:33 +080087 mkdir -p /var/run/sshd ${TOOLS_DIR} ${COMPILER_DIR};\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010088 # Run shell script(s) to install files, toolchains, etc...
89 bash -ex /tmp/tf-dependencies.install ;\
Fathi Boudraafdf3d42020-11-20 14:14:48 +010090 bash -ex /tmp/tf-environment.install ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010091 # Fix permissions
Xinyu Zhang4987d4c2022-01-13 18:51:33 +080092 chown -R buildslave:buildslave ${TOOLS_DIR} ${COMPILER_DIR} /usr/share/plantuml ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010093 # Cleanup
94 apt clean ;\
95 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Leonardo Sandoval7c2a7f42020-08-27 11:31:34 -050096
Fathi Boudra0c3d4c72020-12-17 12:33:43 +010097USER buildslave
98
99RUN set -e ;\
100 # Set git default config
101 git config --global user.email "ci@trustedfirmware.org" ;\
102 git config --global user.name "TF CI" ;\
103 git config --global color.ui "auto"
104
105USER root
106
Benjamin Copelandf7991f22020-07-30 14:01:21 +0100107EXPOSE 22
108ENTRYPOINT ["/usr/sbin/setup-sshd"]
Riku Voipio03ffb3c2021-09-30 19:20:22 +0300109