Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 1 | FROM ubuntu:bionic |
| 2 | |
Fathi Boudra | e236113 | 2020-11-10 19:30:58 +0100 | [diff] [blame^] | 3 | # Environment variables used by CI scripts |
| 4 | ENV DOCKER_PREFIX=987685672616.dkr.ecr.us-east-1.amazonaws.com |
| 5 | ENV LICENSE_VARIABLE=ARMLMD_LICENSE_FILE=27000@ci.trustedfirmware.org |
| 6 | |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 7 | ENV DEBIAN_FRONTEND=noninteractive |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 8 | ENV TOOLS_DIR=/home/buildslave/tools |
| 9 | ENV PATH=${TOOLS_DIR}/bin:${PATH} |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 10 | ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar |
| 11 | ENV PKG_DEPS="\ |
Mate Toth-Pal | 4e6f101 | 2020-07-07 10:13:07 +0200 | [diff] [blame] | 12 | bison \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 13 | build-essential \ |
Leonardo Sandoval | 23c34d1 | 2020-10-15 12:20:59 -0500 | [diff] [blame] | 14 | clang-tools-6.0 \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 15 | curl \ |
| 16 | default-jre \ |
| 17 | device-tree-compiler \ |
| 18 | doxygen \ |
Karl Zhang | edefe66 | 2020-09-15 18:12:19 +0800 | [diff] [blame] | 19 | exuberant-ctags \ |
Mate Toth-Pal | 4e6f101 | 2020-07-07 10:13:07 +0200 | [diff] [blame] | 20 | flex \ |
Benjamin Copeland | 08f7e24 | 2020-06-30 13:38:41 +0100 | [diff] [blame] | 21 | g++-multilib \ |
| 22 | gcc-multilib \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 23 | git \ |
| 24 | graphviz \ |
| 25 | jq \ |
Karl Zhang | edefe66 | 2020-09-15 18:12:19 +0800 | [diff] [blame] | 26 | lcov \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 27 | libffi-dev \ |
| 28 | libssl-dev \ |
Leonardo Sandoval | 0485195 | 2020-10-15 12:05:12 -0500 | [diff] [blame] | 29 | libxml-libxml-perl \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 30 | 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 |
| 50 | ARG BUILDSLAVE_PASSWORD=buildslave |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 51 | |
| 52 | COPY requirements_*.txt /opt/ |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 53 | COPY tf-*.install /tmp/ |
Benjamin Copeland | f7991f2 | 2020-07-30 14:01:21 +0100 | [diff] [blame] | 54 | COPY setup-sshd /usr/sbin/setup-sshd |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 55 | |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 56 | RUN 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 Sandoval | 7c2a7f4 | 2020-08-27 11:31:34 -0500 | [diff] [blame] | 84 | |
Benjamin Copeland | f7991f2 | 2020-07-30 14:01:21 +0100 | [diff] [blame] | 85 | EXPOSE 22 |
| 86 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |