2020-01-22 19:04:13 +01:00
|
|
|
FROM debian:testing
|
|
|
|
|
2020-01-24 10:06:42 +01:00
|
|
|
RUN echo "deb [trusted=yes] http://apt.llvm.org/buster/ llvm-toolchain-buster-10 main\n$(cat /etc/apt/sources.list)" > /etc/apt/sources.list;\
|
2020-01-23 16:14:12 +01:00
|
|
|
apt-get update ;\
|
2020-01-22 19:04:13 +01:00
|
|
|
apt-get install -y --no-install-recommends locales \
|
2020-03-23 15:34:23 +01:00
|
|
|
cmake ninja-build git ca-certificates clang lld ccache python3 build-essential openssh-client\
|
2020-01-22 19:04:13 +01:00
|
|
|
clang-tidy clang-format \
|
|
|
|
python3-psutil arcanist zip wget \
|
|
|
|
openjdk-11-jdk \
|
|
|
|
python3-pip python3-setuptools \
|
|
|
|
swig python3-dev libedit-dev libncurses5-dev libxml2-dev liblzma-dev golang rsync jq; \
|
|
|
|
apt-get clean
|
|
|
|
|
|
|
|
# Make python3 default (needed by git-clang-format and others).
|
|
|
|
RUN rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python
|
|
|
|
|
|
|
|
ARG user=jenkins
|
|
|
|
ARG group=jenkins
|
|
|
|
ARG uid=1000
|
|
|
|
ARG gid=1000
|
|
|
|
ARG AGENT_WORKDIR=/home/${user}/agent
|
|
|
|
|
|
|
|
RUN mkdir -p /scripts
|
|
|
|
|
|
|
|
# install the swarm client
|
|
|
|
RUN cd /scripts ;\
|
|
|
|
wget https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/3.17/swarm-client-3.17.jar ;\
|
|
|
|
mv swarm-client-3.17.jar swarm-client.jar
|
|
|
|
|
|
|
|
COPY start_agent.sh report_results.sh /scripts/
|
|
|
|
|
2020-03-23 15:34:23 +01:00
|
|
|
# store SSH known hosts for github, required for ssh authentication
|
|
|
|
RUN mkdir -p /home/${user}/.ssh
|
|
|
|
COPY known_hosts /home/${user}/.ssh/known_hosts
|
|
|
|
|
2020-01-22 19:04:13 +01:00
|
|
|
# install python dependencies for the scripts
|
|
|
|
# ADD will checks that contentent of a file has changed.
|
2020-01-28 16:36:59 +01:00
|
|
|
ADD "https://raw.githubusercontent.com/google/llvm-premerge-checks/master/scripts/requirements.txt" requirements.txt
|
2020-01-22 19:04:13 +01:00
|
|
|
RUN pip3 install -r requirements.txt
|
|
|
|
|
|
|
|
RUN groupadd -g ${gid} ${group} ;\
|
|
|
|
useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user} ;\
|
|
|
|
mkdir /home/${user}/ccache
|
|
|
|
|
|
|
|
RUN chown -R ${user}:${user} /home/${user}
|
|
|
|
|
|
|
|
WORKDIR /home/${user}
|
|
|
|
ENV CCACHE_PATH=/mnt/disks/ssd0/ccache
|
|
|
|
|
|
|
|
# configure locale
|
|
|
|
RUN sed --in-place '/en_US.UTF-8/s/^#//' /etc/locale.gen ;\
|
|
|
|
locale-gen
|
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
ENV LANGUAGE en_US:en
|
|
|
|
ENV LC_ALL en_US.UTF-8
|
|
|
|
|
|
|
|
CMD ["/scripts/start_agent.sh"]
|
|
|
|
|