blob: 9f961abe9a77b2b1ab9c918de9b2cbc0b3c80b3f [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
4ENV DOCKER_PREFIX=987685672616.dkr.ecr.us-east-1.amazonaws.com
5ENV LICENSE_VARIABLE=ARMLMD_LICENSE_FILE=27000@ci.trustedfirmware.org
6
Benjamin Copelande2772152020-06-17 11:54:56 +01007ENV DEBIAN_FRONTEND=noninteractive
Fathi Boudra0a2e8002020-11-10 19:10:30 +01008ENV TOOLS_DIR=/home/buildslave/tools
9ENV PATH=${TOOLS_DIR}/bin:${PATH}
Benjamin Copelande2772152020-06-17 11:54:56 +010010ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar
11ENV PKG_DEPS="\
Mate Toth-Pal4e6f1012020-07-07 10:13:07 +020012 bison \
Benjamin Copelande2772152020-06-17 11:54:56 +010013 build-essential \
Leonardo Sandoval23c34d12020-10-15 12:20:59 -050014 clang-tools-6.0 \
Benjamin Copelande2772152020-06-17 11:54:56 +010015 curl \
16 default-jre \
17 device-tree-compiler \
18 doxygen \
Karl Zhangedefe662020-09-15 18:12:19 +080019 exuberant-ctags \
Mate Toth-Pal4e6f1012020-07-07 10:13:07 +020020 flex \
Benjamin Copeland08f7e242020-06-30 13:38:41 +010021 g++-multilib \
22 gcc-multilib \
Benjamin Copelande2772152020-06-17 11:54:56 +010023 git \
24 graphviz \
25 jq \
Karl Zhangedefe662020-09-15 18:12:19 +080026 lcov \
Benjamin Copelande2772152020-06-17 11:54:56 +010027 libffi-dev \
28 libssl-dev \
Leonardo Sandoval04851952020-10-15 12:05:12 -050029 libxml-libxml-perl \
Benjamin Copelande2772152020-06-17 11:54:56 +010030 openjdk-8-jdk \
31 openssh-server \
32 perl \
33 python \
34 python-psutil \
35 python3 \
36 python3-crypto \
37 python3-dev \
38 python3-psutil \
39 python3-pyasn1 \
40 srecord \
41 sudo \
42 tree \
43 unzip \
44 virtualenv \
45 wget \
46 zip \
47"
48
49# Can be overriden at build time
50ARG BUILDSLAVE_PASSWORD=buildslave
Benjamin Copelande2772152020-06-17 11:54:56 +010051
52COPY requirements_*.txt /opt/
Fathi Boudra0a2e8002020-11-10 19:10:30 +010053COPY tf-*.install /tmp/
Benjamin Copelandf7991f22020-07-30 14:01:21 +010054COPY setup-sshd /usr/sbin/setup-sshd
Benjamin Copelande2772152020-06-17 11:54:56 +010055
Fathi Boudra0a2e8002020-11-10 19:10:30 +010056RUN set -e ;\
57 apt update -q=2 ;\
58 apt dist-upgrade -q=2 --yes ;\
59 apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
60 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\
61 apt update -q=2 ;\
62 apt install -q=2 --yes --no-install-recommends git-lfs ;\
63 # Install Python requirements
64 curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py ;\
65 python2 /tmp/get-pip.py ;\
66 pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\
67 python3 /tmp/get-pip.py ;\
68 pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
69 # Set Python 3 as default
70 ln -s -f /usr/bin/python3 /usr/bin/python ;\
71 # Setup buildslave user for Jenkins
72 useradd -m -s /bin/bash buildslave ;\
73 echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\
74 echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\
75 chmod 0440 /etc/sudoers.d/jenkins ;\
76 mkdir -p /var/run/sshd ${TOOLS_DIR} ;\
77 # Run shell script(s) to install files, toolchains, etc...
78 bash -ex /tmp/tf-dependencies.install ;\
79 # Fix permissions
80 chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml ;\
81 # Cleanup
82 apt clean ;\
83 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Leonardo Sandoval7c2a7f42020-08-27 11:31:34 -050084
Benjamin Copelandf7991f22020-07-30 14:01:21 +010085EXPOSE 22
86ENTRYPOINT ["/usr/sbin/setup-sshd"]