2023-08-28 12:05:01 +02:00
|
|
|
FROM ubuntu:latest
|
2022-12-25 14:57:47 +01:00
|
|
|
|
2023-09-11 18:37:33 +02:00
|
|
|
# Make sure apt-get doesn't try to prompt for stuff like our time zone, etc.
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2022-12-25 14:57:47 +01:00
|
|
|
RUN echo 'intall packages'; \
|
|
|
|
apt-get update; \
|
2023-08-28 12:05:01 +02:00
|
|
|
apt-get upgrade; \
|
2022-12-25 14:57:47 +01:00
|
|
|
apt-get install -y --no-install-recommends \
|
2023-09-11 18:37:33 +02:00
|
|
|
gosu tini \
|
|
|
|
locales openssh-client gnupg ca-certificates apt-transport-https \
|
2023-08-28 12:05:01 +02:00
|
|
|
zip wget curl git \
|
2023-04-21 10:15:01 +02:00
|
|
|
gdb build-essential \
|
2022-12-25 14:57:47 +01:00
|
|
|
ninja-build \
|
2023-08-28 12:05:01 +02:00
|
|
|
libelf-dev libffi-dev gcc-multilib libmpfr-dev libpfm4-dev \
|
2023-01-30 12:48:19 +01:00
|
|
|
# for llvm-libc tests that build mpfr and gmp from source
|
2022-12-25 14:57:47 +01:00
|
|
|
autoconf automake libtool \
|
2023-08-28 12:05:01 +02:00
|
|
|
python3 python3-psutil python3-pip python3-setuptools \
|
2022-12-25 14:57:47 +01:00
|
|
|
lsb-release software-properties-common \
|
2023-01-30 12:48:19 +01:00
|
|
|
swig python3-dev libedit-dev libncurses5-dev libxml2-dev liblzma-dev golang rsync jq \
|
2023-09-11 18:37:33 +02:00
|
|
|
# for libc++ tests that use the timezone database of the chrono header
|
|
|
|
tzdata \
|
2023-01-30 12:48:19 +01:00
|
|
|
# for llvm installation script
|
2023-08-28 12:05:01 +02:00
|
|
|
sudo \
|
|
|
|
# build scripts
|
|
|
|
nodejs ccache \
|
2023-09-11 18:37:33 +02:00
|
|
|
# shell users
|
|
|
|
less vim
|
2022-12-25 14:57:47 +01:00
|
|
|
|
2023-08-28 12:05:01 +02:00
|
|
|
# Install cmake 3.23+ from source.
|
2023-04-21 10:15:01 +02:00
|
|
|
RUN wget --no-verbose -O /cmake.sh https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3-linux-x86_64.sh; \
|
|
|
|
chmod +x /cmake.sh; \
|
|
|
|
mkdir -p /etc/cmake; \
|
|
|
|
/cmake.sh --prefix=/etc/cmake --skip-license; \
|
|
|
|
ln -s /etc/cmake/bin/cmake /usr/bin/cmake; \
|
|
|
|
cmake --version; \
|
|
|
|
rm /cmake.sh
|
|
|
|
|
2023-08-28 12:05:01 +02:00
|
|
|
# Install sccache.
|
|
|
|
RUN curl -o sccache-v0.5.4-x86_64-unknown-linux-musl.tar.gz -L https://github.com/mozilla/sccache/releases/download/v0.5.4/sccache-v0.5.4-x86_64-unknown-linux-musl.tar.gz \
|
|
|
|
&& echo "4bf3ce366aa02599019093584a5cbad4df783f8d6e3610548c2044daa595d40b sccache-v0.5.4-x86_64-unknown-linux-musl.tar.gz" | shasum -a 256 -c \
|
|
|
|
&& tar xzf ./sccache-v0.5.4-x86_64-unknown-linux-musl.tar.gz \
|
|
|
|
&& mv sccache-v0.5.4-x86_64-unknown-linux-musl/sccache /usr/bin \
|
|
|
|
&& chown root:root /usr/bin/sccache \
|
|
|
|
&& ls -la /usr/bin/sccache \
|
|
|
|
&& sccache --version
|
|
|
|
|
2022-12-25 14:57:47 +01:00
|
|
|
# LLVM must be installed after prerequsite packages.
|
2023-04-21 10:15:01 +02:00
|
|
|
ENV LLVM_VERSION=16
|
2023-08-28 12:05:01 +02:00
|
|
|
RUN echo 'install llvm ${LLVM_VERSION}' && \
|
|
|
|
wget --no-verbose https://apt.llvm.org/llvm.sh && \
|
|
|
|
chmod +x llvm.sh && \
|
|
|
|
./llvm.sh ${LLVM_VERSION} && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y clang-${LLVM_VERSION} clang-format-${LLVM_VERSION} clang-tidy-${LLVM_VERSION} lld-${LLVM_VERSION} && \
|
|
|
|
ln -s /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang && \
|
|
|
|
ln -s /usr/bin/clang++-${LLVM_VERSION} /usr/bin/clang++ && \
|
|
|
|
ln -s /usr/bin/clang-tidy-${LLVM_VERSION} /usr/bin/clang-tidy && \
|
|
|
|
ln -s /usr/bin/clang-tidy-diff-${LLVM_VERSION}.py /usr/bin/clang-tidy-diff && \
|
|
|
|
ln -s /usr/bin/clang-format-${LLVM_VERSION} /usr/bin/clang-format && \
|
|
|
|
ln -s /usr/bin/clang-format-diff-${LLVM_VERSION} /usr/bin/clang-format-diff && \
|
|
|
|
ln -s /usr/bin/lld-${LLVM_VERSION} /usr/bin/lld && \
|
|
|
|
ln -s /usr/bin/lldb-${LLVM_VERSION} /usr/bin/lldb && \
|
|
|
|
ln -s /usr/bin/ld.lld-${LLVM_VERSION} /usr/bin/ld.lld && \
|
|
|
|
clang --version
|
2022-12-25 14:57:47 +01:00
|
|
|
|
2023-08-28 12:05:01 +02:00
|
|
|
RUN echo 'configure locale' && \
|
|
|
|
sed --in-place '/en_US.UTF-8/s/^#//' /etc/locale.gen && \
|
|
|
|
locale-gen
|
2022-12-25 14:57:47 +01:00
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
ENV LANGUAGE en_US:en
|
|
|
|
ENV LC_ALL en_US.UTF-8
|
2020-04-22 16:51:22 +02:00
|
|
|
|
2023-09-11 18:37:33 +02:00
|
|
|
COPY *.sh /usr/local/bin/
|
|
|
|
RUN chmod og+rx /usr/local/bin/*.sh
|
2023-08-28 12:05:01 +02:00
|
|
|
|
2020-04-22 16:51:22 +02:00
|
|
|
RUN echo 'install buildkite' ;\
|
|
|
|
apt-get install -y apt-transport-https gnupg;\
|
|
|
|
sh -c 'echo deb https://apt.buildkite.com/buildkite-agent stable main > /etc/apt/sources.list.d/buildkite-agent.list' ;\
|
|
|
|
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 32A37959C2FA5C3C99EFBC32A79206696452D198 ;\
|
|
|
|
apt-get update ;\
|
2021-05-15 10:58:23 +02:00
|
|
|
apt-get install -y buildkite-agent tini gosu; \
|
2020-04-22 16:51:22 +02:00
|
|
|
apt-get clean;
|
2023-08-28 12:05:01 +02:00
|
|
|
|
2020-06-17 14:41:00 +02:00
|
|
|
COPY --chown=buildkite-agent:buildkite-agent pre-checkout /etc/buildkite-agent/hooks
|
2023-10-13 17:05:56 +02:00
|
|
|
COPY --chown=buildkite-agent:buildkite-agent post-checkout /etc/buildkite-agent/hooks
|
2021-05-14 14:54:57 +02:00
|
|
|
|
2022-01-19 13:30:40 +01:00
|
|
|
# buildkite working directory
|
|
|
|
VOLUME /var/lib/buildkite-agent
|
|
|
|
|
2021-05-14 14:54:57 +02:00
|
|
|
ENTRYPOINT ["entrypoint.sh"]
|
2023-09-07 13:08:28 +02:00
|
|
|
CMD ["gosu", "buildkite-agent", "buildkite-agent", "start", "--no-color", "--tags-from-gcp"]
|