aboutsummaryrefslogtreecommitdiff
path: root/bionic-amd64-tf-a-build/Dockerfile
blob: 3ca894fd54bca01cbcb2fbb48a163ccf06646712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
FROM ubuntu:bionic

# Environment variables used by CI scripts
ENV ARMLMD_LICENSE_FILE=27000@ci.trustedfirmware.org

ENV DEBIAN_FRONTEND=noninteractive
ENV NVM_DIR=/usr/local/nvm
ENV TOOLS_DIR=/home/buildslave/tools
ENV PATH=${TOOLS_DIR}/bin:${PATH}
ENV PLANTUML_JAR_PATH=/usr/share/plantuml/plantuml.jar
ENV PKG_DEPS="\
    bc \
    bison \
    build-essential \
    clang-tools-6.0 \
    cpio \
    curl \
    default-jre \
    device-tree-compiler \
    doxygen \
    exuberant-ctags \
    file \
    flex \
    g++-multilib \
    gcc-multilib \
    gdisk \
    git \
    graphviz \
    jq \
    lcov \
    libffi-dev \
    libssl-dev \
    libyaml-dev \
    libxml-libxml-perl \
    lld \
    locales \
    openjdk-8-jdk \
    openssh-server \
    perl \
    python \
    python-psutil \
    python3 \
    python3-crypto \
    python3-dev \
    python3-psutil \
    python3-pyasn1 \
    srecord \
    sudo \
    tree \
    unzip \
    util-linux \
    uuid-runtime \
    virtualenv \
    wget \
    zip \
"

# Can be overriden at build time
ARG BUILDSLAVE_PASSWORD=buildslave

COPY requirements_*.txt /opt/
COPY tf-*.install /tmp/
COPY setup-sshd /usr/sbin/setup-sshd

RUN set -e ;\
    echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections ;\
    echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections ;\
    apt update -q=2 ;\
    apt dist-upgrade -q=2 --yes ;\
    apt install -q=2 --yes --no-install-recommends ${PKG_DEPS} ;\
    curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash ;\
    apt update -q=2 ;\
    apt install -q=2 --yes --no-install-recommends git-lfs ;\
    # Install Python requirements
    curl -s https://bootstrap.pypa.io/pip/3.5/get-pip.py -o /tmp/get-pip.py ;\
    python2 /tmp/get-pip.py ;\
    pip2 install --no-cache-dir -r /opt/requirements_python2.txt ;\
    python3 /tmp/get-pip.py ;\
    pip3 install --no-cache-dir -r /opt/requirements_python3.txt ;\
    # Set Python 3 as default
    ln -s -f /usr/bin/python3 /usr/bin/python ;\
    # Setup buildslave user for Jenkins
    useradd -m -s /bin/bash buildslave ;\
    echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\
    echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\
    chmod 0440 /etc/sudoers.d/jenkins ;\
    # FIXME: add /arm as a temporary workaround until ARM CI moves to Open CI paths
    mkdir -p /var/run/sshd ${TOOLS_DIR} /arm ;\
    # Run shell script(s) to install files, toolchains, etc...
    bash -ex /tmp/tf-dependencies.install ;\
    bash -ex /tmp/tf-environment.install ;\
    # Fix permissions
    chown -R buildslave:buildslave ${TOOLS_DIR} /usr/share/plantuml /nfs/downloads/linaro /arm ;\
    # Cleanup
    apt clean ;\
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

EXPOSE 22
ENTRYPOINT ["/usr/sbin/setup-sshd"]