blob: 43bc9cc1e6c6303792f4240c0a6b34bdb0be7238 [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
12ENV PKG_DEPS="\
Mate Toth-Pal4e6f1012020-07-07 10:13:07 +020013 bison \
Benjamin Copelande2772152020-06-17 11:54:56 +010014 build-essential \
Leonardo Sandoval23c34d12020-10-15 12:20:59 -050015 clang-tools-6.0 \
Benjamin Copelande2772152020-06-17 11:54:56 +010016 curl \
17 default-jre \
18 device-tree-compiler \
19 doxygen \
Karl Zhangedefe662020-09-15 18:12:19 +080020 exuberant-ctags \
Mate Toth-Pal4e6f1012020-07-07 10:13:07 +020021 flex \
Benjamin Copeland08f7e242020-06-30 13:38:41 +010022 g++-multilib \
23 gcc-multilib \
Benjamin Copelande2772152020-06-17 11:54:56 +010024 git \
25 graphviz \
26 jq \
Karl Zhangedefe662020-09-15 18:12:19 +080027 lcov \
Benjamin Copelande2772152020-06-17 11:54:56 +010028 libffi-dev \
Summer Qin14d6bf72021-06-23 14:06:02 +080029 librsvg2-bin \
Benjamin Copelande2772152020-06-17 11:54:56 +010030 libssl-dev \
Leonardo Sandoval04851952020-10-15 12:05:12 -050031 libxml-libxml-perl \
Fathi Boudra8cd1ff62021-01-21 15:51:45 +010032 locales \
Benjamin Copelande2772152020-06-17 11:54:56 +010033 openjdk-8-jdk \
34 openssh-server \
35 perl \
36 python \
37 python-psutil \
38 python3 \
39 python3-crypto \
40 python3-dev \
41 python3-psutil \
42 python3-pyasn1 \
43 srecord \
44 sudo \
45 tree \
46 unzip \
47 virtualenv \
48 wget \
49 zip \
50"
51
52# Can be overriden at build time
53ARG BUILDSLAVE_PASSWORD=buildslave
Benjamin Copelande2772152020-06-17 11:54:56 +010054
55COPY requirements_*.txt /opt/
Fathi Boudra0a2e8002020-11-10 19:10:30 +010056COPY tf-*.install /tmp/
Benjamin Copelandf7991f22020-07-30 14:01:21 +010057COPY setup-sshd /usr/sbin/setup-sshd
Benjamin Copelande2772152020-06-17 11:54:56 +010058
Fathi Boudra0a2e8002020-11-10 19:10:30 +010059RUN set -e ;\
Fathi Boudra8cd1ff62021-01-21 15:51:45 +010060 echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\
61 echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010062 apt update -q=2 ;\
63 apt dist-upgrade -q=2 --yes ;\
64 apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
65 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\
66 apt update -q=2 ;\
67 apt install -q=2 --yes --no-install-recommends git-lfs ;\
68 # Install Python requirements
Arthur She5bf67462021-03-11 22:59:11 -080069 curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010070 python2 /tmp/get-pip.py ;\
71 pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\
72 python3 /tmp/get-pip.py ;\
73 pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
74 # Set Python 3 as default
75 ln -s -f /usr/bin/python3 /usr/bin/python ;\
76 # Setup buildslave user for Jenkins
77 useradd -m -s /bin/bash buildslave ;\
78 echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\
79 echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\
80 chmod 0440 /etc/sudoers.d/jenkins ;\
81 mkdir -p /var/run/sshd ${TOOLS_DIR} ;\
82 # Run shell script(s) to install files, toolchains, etc...
83 bash -ex /tmp/tf-dependencies.install ;\
Fathi Boudraafdf3d42020-11-20 14:14:48 +010084 bash -ex /tmp/tf-environment.install ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010085 # Fix permissions
86 chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml ;\
87 # Cleanup
88 apt clean ;\
89 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Leonardo Sandoval7c2a7f42020-08-27 11:31:34 -050090
Fathi Boudra0c3d4c72020-12-17 12:33:43 +010091USER buildslave
92
93RUN set -e ;\
94 # Set git default config
95 git config --global user.email "ci@trustedfirmware.org" ;\
96 git config --global user.name "TF CI" ;\
97 git config --global color.ui "auto"
98
99USER root
100
Benjamin Copelandf7991f22020-07-30 14:01:21 +0100101EXPOSE 22
102ENTRYPOINT ["/usr/sbin/setup-sshd"]