Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 1 | FROM ubuntu:bionic |
| 2 | |
Leonardo Sandoval | 7c2a7f4 | 2020-08-27 11:31:34 -0500 | [diff] [blame] | 3 | ENV ARMLMD_LICENSE_FILE=27000@ci.trustedfirmware.org |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 4 | ENV DEBIAN_FRONTEND=noninteractive |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 5 | ENV TOOLS_DIR=/home/buildslave/tools |
| 6 | ENV PATH=${TOOLS_DIR}/bin:${PATH} |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 7 | ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar |
| 8 | ENV PKG_DEPS="\ |
Mate Toth-Pal | 4e6f101 | 2020-07-07 10:13:07 +0200 | [diff] [blame] | 9 | bison \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 10 | build-essential \ |
Leonardo Sandoval | 23c34d1 | 2020-10-15 12:20:59 -0500 | [diff] [blame] | 11 | clang-tools-6.0 \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 12 | curl \ |
| 13 | default-jre \ |
| 14 | device-tree-compiler \ |
| 15 | doxygen \ |
Karl Zhang | edefe66 | 2020-09-15 18:12:19 +0800 | [diff] [blame] | 16 | exuberant-ctags \ |
Mate Toth-Pal | 4e6f101 | 2020-07-07 10:13:07 +0200 | [diff] [blame] | 17 | flex \ |
Benjamin Copeland | 08f7e24 | 2020-06-30 13:38:41 +0100 | [diff] [blame] | 18 | g++-multilib \ |
| 19 | gcc-multilib \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 20 | git \ |
| 21 | graphviz \ |
| 22 | jq \ |
Karl Zhang | edefe66 | 2020-09-15 18:12:19 +0800 | [diff] [blame] | 23 | lcov \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 24 | libffi-dev \ |
| 25 | libssl-dev \ |
Leonardo Sandoval | 0485195 | 2020-10-15 12:05:12 -0500 | [diff] [blame] | 26 | libxml-libxml-perl \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 27 | openjdk-8-jdk \ |
| 28 | openssh-server \ |
| 29 | perl \ |
| 30 | python \ |
| 31 | python-psutil \ |
| 32 | python3 \ |
| 33 | python3-crypto \ |
| 34 | python3-dev \ |
| 35 | python3-psutil \ |
| 36 | python3-pyasn1 \ |
| 37 | srecord \ |
| 38 | sudo \ |
| 39 | tree \ |
| 40 | unzip \ |
| 41 | virtualenv \ |
| 42 | wget \ |
| 43 | zip \ |
| 44 | " |
| 45 | |
| 46 | # Can be overriden at build time |
| 47 | ARG BUILDSLAVE_PASSWORD=buildslave |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 48 | |
| 49 | COPY requirements_*.txt /opt/ |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 50 | COPY tf-*.install /tmp/ |
Benjamin Copeland | f7991f2 | 2020-07-30 14:01:21 +0100 | [diff] [blame] | 51 | COPY setup-sshd /usr/sbin/setup-sshd |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 52 | |
Fathi Boudra | 0a2e800 | 2020-11-10 19:10:30 +0100 | [diff] [blame] | 53 | RUN set -e ;\ |
| 54 | apt update -q=2 ;\ |
| 55 | apt dist-upgrade -q=2 --yes ;\ |
| 56 | apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\ |
| 57 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\ |
| 58 | apt update -q=2 ;\ |
| 59 | apt install -q=2 --yes --no-install-recommends git-lfs ;\ |
| 60 | # Install Python requirements |
| 61 | curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py ;\ |
| 62 | python2 /tmp/get-pip.py ;\ |
| 63 | pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\ |
| 64 | python3 /tmp/get-pip.py ;\ |
| 65 | pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\ |
| 66 | # Set Python 3 as default |
| 67 | ln -s -f /usr/bin/python3 /usr/bin/python ;\ |
| 68 | # Setup buildslave user for Jenkins |
| 69 | useradd -m -s /bin/bash buildslave ;\ |
| 70 | echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
| 71 | echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
| 72 | chmod 0440 /etc/sudoers.d/jenkins ;\ |
| 73 | mkdir -p /var/run/sshd ${TOOLS_DIR} ;\ |
| 74 | # Run shell script(s) to install files, toolchains, etc... |
| 75 | bash -ex /tmp/tf-dependencies.install ;\ |
| 76 | # Fix permissions |
| 77 | chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml ;\ |
| 78 | # Cleanup |
| 79 | apt clean ;\ |
| 80 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
Leonardo Sandoval | 7c2a7f4 | 2020-08-27 11:31:34 -0500 | [diff] [blame] | 81 | |
Benjamin Copeland | f7991f2 | 2020-07-30 14:01:21 +0100 | [diff] [blame] | 82 | EXPOSE 22 |
| 83 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |