blob: 3760a13e442ea08dc18a82b1a04a8e028677a014 [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 \
Benjamin Copelande2772152020-06-17 11:54:56 +010031 openjdk-8-jdk \
32 openssh-server \
33 perl \
34 python \
35 python-psutil \
36 python3 \
37 python3-crypto \
38 python3-dev \
39 python3-psutil \
40 python3-pyasn1 \
41 srecord \
42 sudo \
43 tree \
44 unzip \
45 virtualenv \
46 wget \
47 zip \
48"
49
50# Can be overriden at build time
51ARG BUILDSLAVE_PASSWORD=buildslave
Benjamin Copelande2772152020-06-17 11:54:56 +010052
53COPY requirements_*.txt /opt/
Fathi Boudra0a2e8002020-11-10 19:10:30 +010054COPY tf-*.install /tmp/
Benjamin Copelandf7991f22020-07-30 14:01:21 +010055COPY setup-sshd /usr/sbin/setup-sshd
Benjamin Copelande2772152020-06-17 11:54:56 +010056
Fathi Boudra0a2e8002020-11-10 19:10:30 +010057RUN set -e ;\
58 apt update -q=2 ;\
59 apt dist-upgrade -q=2 --yes ;\
60 apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
61 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\
62 apt update -q=2 ;\
63 apt install -q=2 --yes --no-install-recommends git-lfs ;\
64 # Install Python requirements
65 curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py ;\
66 python2 /tmp/get-pip.py ;\
67 pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\
68 python3 /tmp/get-pip.py ;\
69 pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
70 # Set Python 3 as default
71 ln -s -f /usr/bin/python3 /usr/bin/python ;\
72 # Setup buildslave user for Jenkins
73 useradd -m -s /bin/bash buildslave ;\
74 echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\
75 echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\
76 chmod 0440 /etc/sudoers.d/jenkins ;\
77 mkdir -p /var/run/sshd ${TOOLS_DIR} ;\
78 # Run shell script(s) to install files, toolchains, etc...
79 bash -ex /tmp/tf-dependencies.install ;\
Fathi Boudraafdf3d42020-11-20 14:14:48 +010080 bash -ex /tmp/tf-environment.install ;\
Fathi Boudra0a2e8002020-11-10 19:10:30 +010081 # Fix permissions
82 chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml ;\
83 # Cleanup
84 apt clean ;\
85 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Leonardo Sandoval7c2a7f42020-08-27 11:31:34 -050086
Benjamin Copelandf7991f22020-07-30 14:01:21 +010087EXPOSE 22
88ENTRYPOINT ["/usr/sbin/setup-sshd"]