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 | ARG TOOLS_DIR=/home/buildslave/tools |
| 4 | |
| 5 | ENV ARMLMD_LICENSE_FILE=27000@ci.trustedfirmware.org |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 6 | ENV DEBIAN_FRONTEND=noninteractive |
Leonardo Sandoval | 7c2a7f4 | 2020-08-27 11:31:34 -0500 | [diff] [blame] | 7 | ENV PATH=$TOOLS_DIR/bin:${PATH} |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 8 | ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar |
| 9 | ENV PKG_DEPS="\ |
Mate Toth-Pal | 4e6f101 | 2020-07-07 10:13:07 +0200 | [diff] [blame] | 10 | bison \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 11 | build-essential \ |
Leonardo Sandoval | 23c34d1 | 2020-10-15 12:20:59 -0500 | [diff] [blame^] | 12 | clang-tools-6.0 \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 13 | curl \ |
| 14 | default-jre \ |
| 15 | device-tree-compiler \ |
| 16 | doxygen \ |
Karl Zhang | edefe66 | 2020-09-15 18:12:19 +0800 | [diff] [blame] | 17 | exuberant-ctags \ |
Mate Toth-Pal | 4e6f101 | 2020-07-07 10:13:07 +0200 | [diff] [blame] | 18 | flex \ |
Benjamin Copeland | 08f7e24 | 2020-06-30 13:38:41 +0100 | [diff] [blame] | 19 | g++-multilib \ |
| 20 | gcc-multilib \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 21 | git \ |
| 22 | graphviz \ |
| 23 | jq \ |
Karl Zhang | edefe66 | 2020-09-15 18:12:19 +0800 | [diff] [blame] | 24 | lcov \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 25 | libffi-dev \ |
| 26 | libssl-dev \ |
Leonardo Sandoval | 0485195 | 2020-10-15 12:05:12 -0500 | [diff] [blame] | 27 | libxml-libxml-perl \ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 28 | openjdk-8-jdk \ |
| 29 | openssh-server \ |
| 30 | perl \ |
| 31 | python \ |
| 32 | python-psutil \ |
| 33 | python3 \ |
| 34 | python3-crypto \ |
| 35 | python3-dev \ |
| 36 | python3-psutil \ |
| 37 | python3-pyasn1 \ |
| 38 | srecord \ |
| 39 | sudo \ |
| 40 | tree \ |
| 41 | unzip \ |
| 42 | virtualenv \ |
| 43 | wget \ |
| 44 | zip \ |
| 45 | " |
| 46 | |
| 47 | # Can be overriden at build time |
| 48 | ARG BUILDSLAVE_PASSWORD=buildslave |
| 49 | ARG VERSION=3.28 |
| 50 | |
| 51 | COPY requirements_*.txt /opt/ |
| 52 | COPY jenkins-slave /usr/local/bin/jenkins-slave |
Benjamin Copeland | f7991f2 | 2020-07-30 14:01:21 +0100 | [diff] [blame] | 53 | COPY setup-sshd /usr/sbin/setup-sshd |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 54 | |
| 55 | RUN set -e ;\ |
| 56 | apt update -q=2 ;\ |
| 57 | apt dist-upgrade -q=2 --yes ;\ |
| 58 | apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\ |
| 59 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\ |
| 60 | apt update -q=2 ;\ |
| 61 | apt install -q=2 --yes --no-install-recommends git-lfs ;\ |
| 62 | # Install Python requirements |
| 63 | curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py ;\ |
| 64 | python2 /tmp/get-pip.py ;\ |
| 65 | pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\ |
| 66 | python3 /tmp/get-pip.py ;\ |
| 67 | pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\ |
Benjamin Copeland | a38e497 | 2020-06-25 10:24:35 +0100 | [diff] [blame] | 68 | # Set Python 3 as default |
| 69 | ln -s -f /usr/bin/python3 /usr/bin/python ;\ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 70 | # Setup buildslave user for Jenkins |
| 71 | useradd -m -s /bin/bash buildslave ;\ |
| 72 | echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
| 73 | echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
| 74 | chmod 0440 /etc/sudoers.d/jenkins ;\ |
| 75 | mkdir -p /var/run/sshd /home/buildslave/tools ;\ |
| 76 | # Install cppcheck |
| 77 | wget -q http://github.com/danmar/cppcheck/releases/download/1.81/cppcheck-1.81.tar.gz -O /tmp/cppcheck.tar.gz ;\ |
| 78 | tar -xf /tmp/cppcheck.tar.gz -C /opt ;\ |
| 79 | (cd /opt/cppcheck-*; make CFGDIR=/opt/cppcheck-1.81/cfg; make install; make clean) ;\ |
| 80 | # Install PlantUML |
| 81 | curl --create-dirs -fsSLo ${PLANTUML_JAR_PATH} https://repo1.maven.org/maven2/net/sourceforge/plantuml/plantuml/1.2019.6/plantuml-1.2019.6.jar ;\ |
| 82 | # Install Jenkins remoting |
| 83 | curl --create-dirs -fsSLo /usr/share/jenkins/slave.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar ;\ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 84 | # Install CMake |
Karl Zhang | f398da1 | 2020-09-08 10:29:46 +0800 | [diff] [blame] | 85 | curl --create-dirs -fsSLo /tmp/cmake-Linux-x86_64.tar.gz https://cmake.org/files/v3.15/cmake-3.15.0-Linux-x86_64.tar.gz ;\ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 86 | tar -xf /tmp/cmake-Linux-x86_64.tar.gz -C /home/buildslave/tools --strip-components=1 ;\ |
| 87 | # Fix permissions |
| 88 | chmod 0755 /usr/share/jenkins ;\ |
| 89 | chmod 0644 /usr/share/jenkins/slave.jar ;\ |
| 90 | chmod 0755 /usr/local/bin/jenkins-slave ;\ |
Benjamin Copeland | 28a11fd | 2020-08-10 11:48:47 +0100 | [diff] [blame] | 91 | chown -R buildslave:buildslave /home/buildslave/tools /usr/share/plantuml ;\ |
Benjamin Copeland | e277215 | 2020-06-17 11:54:56 +0100 | [diff] [blame] | 92 | # Cleanup |
| 93 | apt clean ;\ |
| 94 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 95 | |
Leonardo Sandoval | 7c2a7f4 | 2020-08-27 11:31:34 -0500 | [diff] [blame] | 96 | ## Latest toolchains, available in $PATH. There can be newer versions of toolchains at |
| 97 | ## upstream projects but these are latest for the docker image |
| 98 | |
| 99 | ### Install GNU toolchain (arm-none-eabi) |
| 100 | ARG GNU_GCC_ARM_VERSION="7-2018-q2-update" |
| 101 | ARG GNU_GCC_ARM_TAR="gcc-arm-none-eabi-${GNU_GCC_ARM_VERSION}-linux.tar.bz2" |
| 102 | ARG GNU_GCC_ARM_URL='https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2\ |
| 103 | ?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain%20Downloads,64-bit,,Linux,7-2018-q2-update' |
| 104 | |
| 105 | RUN curl --create-dirs -fsSLo /tmp/${GNU_GCC_ARM_TAR} ${GNU_GCC_ARM_URL} ;\ |
| 106 | tar -xf /tmp/${GNU_GCC_ARM_TAR} -C ${TOOLS_DIR} --strip-components=1 ;\ |
| 107 | rm /tmp/${GNU_GCC_ARM_TAR} |
| 108 | |
| 109 | ### Install GNU toolchain (aarch64-none-elf) |
| 110 | ARG GNU_GCC_AARCH64_VERSION="9.2-2019.12" |
| 111 | ARG GNU_GCC_AARCH64_TAR="gcc-arm-${GNU_GCC_AARCH64_VERSION}-x86_64-aarch64-none-elf.tar.xz" |
| 112 | ARG GNU_GCC_AARCH64_URL="https://developer.arm.com/-/media/Files/downloads/gnu-a/$GNU_GCC_AARCH64_VERSION/binrel/${GNU_GCC_AARCH64_TAR}" |
| 113 | |
| 114 | RUN curl --create-dirs -fsSLo /tmp/${GNU_GCC_AARCH64_TAR} ${GNU_GCC_AARCH64_URL} ;\ |
| 115 | tar -Jxf /tmp/${GNU_GCC_AARCH64_TAR} -C ${TOOLS_DIR} --strip-components=1 ;\ |
| 116 | rm /tmp/${GNU_GCC_AARCH64_TAR} |
| 117 | |
| 118 | ### Install Arm Clang (armclang) |
| 119 | ARG ARM_CLANG_VERSION="6.13" |
| 120 | ARG ARM_CLANG_TAR="DS500-BN-00026-r5p0-15rel0.tgz" |
| 121 | ARG ARM_CLANG_URL="https://developer.arm.com/-/media/Files/downloads/compiler/DS500-BN-00026-r5p0-15rel0.tgz\ |
| 122 | ?revision=6a961cf7-1d9a-4664-900b-11d20552dbc7?product=Download%20Arm%20Compiler,64-bit,,Linux,6.13" |
| 123 | ARG ARM_CLANG_INSTALL_DIR="${TOOLS_DIR}/armclang" |
| 124 | |
| 125 | RUN curl --create-dirs -fsSLo /tmp/${ARM_CLANG_TAR} ${ARM_CLANG_URL} ;\ |
| 126 | mkdir -p ${ARM_CLANG_INSTALL_DIR} ;\ |
| 127 | tar -xzf /tmp/${ARM_CLANG_TAR} -C ${ARM_CLANG_INSTALL_DIR} ;\ |
| 128 | ${ARM_CLANG_INSTALL_DIR}/install_x86_64.sh \ |
| 129 | --no-interactive \ |
| 130 | --i-agree-to-the-contained-eula \ |
| 131 | -d ${TOOLS_DIR} ;\ |
| 132 | rm -rf ${ARM_CLANG_INSTALL_DIR} /tmp/${ARM_CLANG_TAR} |
| 133 | |
Benjamin Copeland | f7991f2 | 2020-07-30 14:01:21 +0100 | [diff] [blame] | 134 | EXPOSE 22 |
| 135 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |