blob: fd715574c846b9d56e9a4179c60d5e50c11d958a [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
Fathi Boudra07e14472020-11-19 18:56:39 +01004ENV ARMLMD_LICENSE_FILE=27000@ci.trustedfirmware.org
Fathi Boudrae2361132020-11-10 19:30:58 +01005ENV DOCKER_PREFIX=987685672616.dkr.ecr.us-east-1.amazonaws.com
6ENV LICENSE_VARIABLE=ARMLMD_LICENSE_FILE=27000@ci.trustedfirmware.org
7
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 \
29 libssl-dev \
Leonardo Sandoval04851952020-10-15 12:05:12 -050030 libxml-libxml-perl \
Fathi Boudra8cd1ff62021-01-21 15:51:45 +010031 locales \
Benjamin Copelande2772152020-06-17 11:54:56 +010032 openjdk-8-jdk \
33 openssh-server \
34 perl \
35 python \
36 python-psutil \
37 python3 \
38 python3-crypto \
39 python3-dev \
40 python3-psutil \
41 python3-pyasn1 \
42 srecord \
43 sudo \
44 tree \
45 unzip \
46 virtualenv \
47 wget \
48 zip \
49"
50
51# Can be overriden at build time
52ARG BUILDSLAVE_PASSWORD=buildslave
Benjamin Copelande2772152020-06-17 11:54:56 +010053
54COPY requirements_*.txt /opt/
Fathi Boudra0a2e8002020-11-10 19:10:30 +010055COPY tf-*.install /tmp/
Benjamin Copelandf7991f22020-07-30 14:01:21 +010056COPY setup-sshd /usr/sbin/setup-sshd
Benjamin Copelande2772152020-06-17 11:54:56 +010057
Fathi Boudra0a2e8002020-11-10 19:10:30 +010058RUN set -e ;\
Fathi Boudra8cd1ff62021-01-21 15:51:45 +010059 echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\
60 echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010061 apt update -q=2 ;\
62 apt dist-upgrade -q=2 --yes ;\
63 apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
64 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\
65 apt update -q=2 ;\
66 apt install -q=2 --yes --no-install-recommends git-lfs ;\
67 # Install Python requirements
68 curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py ;\
69 python2 /tmp/get-pip.py ;\
70 pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\
71 python3 /tmp/get-pip.py ;\
72 pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
73 # Set Python 3 as default
74 ln -s -f /usr/bin/python3 /usr/bin/python ;\
75 # Setup buildslave user for Jenkins
76 useradd -m -s /bin/bash buildslave ;\
77 echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\
78 echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\
79 chmod 0440 /etc/sudoers.d/jenkins ;\
80 mkdir -p /var/run/sshd ${TOOLS_DIR} ;\
81 # Run shell script(s) to install files, toolchains, etc...
82 bash -ex /tmp/tf-dependencies.install ;\
Fathi Boudraafdf3d42020-11-20 14:14:48 +010083 bash -ex /tmp/tf-environment.install ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010084 # Fix permissions
85 chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml ;\
86 # Cleanup
87 apt clean ;\
88 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Leonardo Sandoval7c2a7f42020-08-27 11:31:34 -050089
Fathi Boudra0c3d4c72020-12-17 12:33:43 +010090USER buildslave
91
92RUN set -e ;\
93 # Set git default config
94 git config --global user.email "ci@trustedfirmware.org" ;\
95 git config --global user.name "TF CI" ;\
96 git config --global color.ui "auto"
97
98USER root
99
Benjamin Copelandf7991f22020-07-30 14:01:21 +0100100EXPOSE 22
101ENTRYPOINT ["/usr/sbin/setup-sshd"]