# Auto generated by ./tcwg-base/generate-dockerfiles.sh from tcwg-base/Dockerfile.in. Do not edit.
FROM ubuntu:jammy
# Use bash for better string escaping (on Ubuntu, /bin/sh is dash).
SHELL ["/bin/bash", "-c"]
# Unminimize Ubuntu to install contrib files of git (after package
# update, otherwise unminimize's "apt upgrade" might fail).
RUN apt-get update \
 && DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y \
 && echo y | unminimize \
# Do we need this?
 && DEBIAN_FRONTEND=noninteractive apt-get install -y devscripts \
 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# Do we need this?
 alien \
 autoconf \
# autogen is used to generate binutils-gdb and gcc's Makefile.in,
# and is also a dependency for gcc/fixincludes, libstdc++-v3 and
# gcc's Rust front-end.
 autogen \
 automake \
 bc \
# "host" is used in dockerfiles.git known_hosts-regen.sh .
 bind9-host \
 bison \
 binutils-dev \
# Do we need this?
 bsd-mailx \
# bsdextrautils need to be explicitely installed on noble.
# Useful at least for hexdump on tcwg_kernel CI projects.
 bsdextrautils \
 build-essential \
 byacc \
 ccache \
# Do we need this?
 ccrypt \
 chrpath \
 clang \
# We need cpio for linux kernel builds.
 cpio \
 curl \
# Do we need this?
 debhelper \
 default-jre \
 dejagnu \
# Do we need this?
 dh-autoreconf \
 dh-translations \
 distro-info-data \
# Do we need this?
 fakeroot \
 flex \
# fp-compiler enables more GDB tests.
 fp-compiler \
 gawk \
# gdc is used by GDB testsuite.
 gdc \
 gdb \
 gdbserver \
# gettext is needed according to README-maintainer-mode
 gettext \
 gfortran \
 git \
# Do we need this?
 # git-annex : is now used to store bmk results in base-artifacts
 git-annex \
 git-filter-repo \
# gm2 is used by GDB testsuite.
 gm2 \
 # For unknown reason "gnat" defaults to "gnat-10" in Jammy, while all other
 # GCC packages default to "*-11" versions.
 gnat-11 \
# Do we need this?
 gobjc \
 gobjc++ \
 golang \
 groff \
 guile-3.0 \
 guile-3.0-dev \
# We use jenkins-jobs in tcwg-check-ci-jobs-vs-yaml .
 jenkins-job-builder \
 jq \
 less \
# libc6-dbg is necessary for armhf debugging, but also helps on aarch64.
 libc6-dbg \
# libcapstone-dev is used by QEMU to generate disassembly traces
 libcapstone-dev \
 libcc1-0 \
# For building lldb.
 libedit-dev \
 libexpat1-dev \
 libffi-dev \
 libglib2.0-dev \
 libgmp-dev \
# libjpeg is necessary for building jipdate
 libjpeg-dev \
 liblzma-dev \
# MPC and MPFR are are by GCC.
 libmpc-dev \
 libmpfr-dev \
# We need libncurses-dev for GDB.  This install libncurses[56] as dependency.
 libncurses-dev \
 libpixman-1-dev \
 libpython3-dev \
 libreadline-dev \
 libssl-dev \
 libtcnative-1 \
# Our bionic-built llvm releases expect to find this but
# focal installs libtinfo6 instead.
 libtinfo5 \
 libtool \
# For building lldb.
 libxml2-dev \
 llvm \
 locales \
# Do we need this?
 lzop \
 make \
# Used GCC to build GCobol documentation.
 mandoc \
 moreutils \
 net-tools \
 netcat-openbsd \
# Do we need this?
# NFS server is used in start-container-qemu.sh, which we don't use anymore.
 nfs-kernel-server \
 ninja-build \
 ntp \
 openssh-server \
 pkg-config \
# We use killall in tcwg-cleanup-stale-containers.sh
 psmisc \
 python3-dev \
 python3-pip \
 python3-setuptools \
 python3-venv \
 python3-wheel \
 python3-pandas \
 python3-numpy \
 python3-scipy \
# Symlink python to python3 to make upstream "repo", which is downloaded
# by distro's repo, happy. Also needed to run lnt checks on focal.
 python-is-python3 \
# Focal doesn't have "repo" package.  We also symlink python to python3
# below solely to make upstream repo, which is downloaded by distro's repo,
# happy.
 repo \
 rsync \
# sqlite3 is used by lnt test suite
 sqlite3 \
# Do we need this?
 subversion \
 sudo \
 swig \
# systemtap-sdt-dev allows building glibc with probes, which GDB uses to
# detect shared library events.
 systemtap-sdt-dev \
# Do we need this?
 tclsh \
 texinfo \
 texlive-fonts-recommended \
 texlive-latex-recommended \
 time \
# tox is used to run lnt test suite
 tox \
 unifdef \
# unzip is needed for aosp builds
 unzip \
 valgrind \
 vim \
# virtualenv is used for lnt environment
 virtualenv \
 wget \
# xsltproc is needed by GDB in maintainer mode
 xsltproc \
 xz-utils \
 zip \
 zlib1g-dev \
 shellcheck \
# Update tzdata, because some base images have an incorrect file for UTC.
 && DEBIAN_FRONTEND=noninteractive apt-get install --reinstall tzdata \
 && rm -f /etc/ssh/ssh_host_*_key* \
 && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN install -D -p -m0755 /usr/share/doc/git/contrib/workdir/git-new-workdir /usr/local/bin/git-new-workdir \
 && sed -i -e 's:^session *required *pam_loginuid.so:# session required pam_loginuid.so:' /etc/pam.d/sshd \
 && mkdir -p /var/run/sshd \
 && sed -i \
 -e "/.*MaxStartups.*/d" \
 -e "/.*MaxSessions.*/d" /etc/ssh/sshd_config \
 && echo "MaxStartups 256" >> /etc/ssh/sshd_config \
 && echo "MaxSessions 256" >> /etc/ssh/sshd_config \
 && locale-gen en_US.UTF-8 && update-locale LANG=en_US.UTF-8
RUN pip3 install git-review \
 && pip3 install psutil \
# flit is used to install jipdate below.
 && pip3 install flit \
# Patchworks client for pre-commit testing with "-f yaml" support and
# shyaml tool to parse its output; these are used in jenkins-scripts/pw-*.sh.
 && pip3 install git-pw && pip3 install shyaml \
# Forgejo client for pre-commit testing, used in
# jenkins-scripts/precommit-forge-*.sh and jenkins-scripts/forgejo-report.py
 && pip3 install pyforgejo \
# tomli package to build qemu
 && pip3 install tomli \
# For testing lldb.
 && pip3 install pexpect \
# Required for qemu build meson > 1.5.0
 && pip3 install meson \
 && true
# Install custom jipdate.
# FIXME: Revert to installing from pip, when pull requests from maxim-kuvyrkov
#        are merged https://github.com/Linaro/jipdate/pulls .
RUN git clone -b master https://github.com/maxim-kuvyrkov/jipdate.git /usr/local/jipdate/ \
 && cd /usr/local/jipdate \
 && flit build \
 && mkdir -p ~/.config/pip \
 && echo $'[global]\nbreak-system-packages = true\n' >> ~/.config/pip/pip.conf \
 && FLIT_ROOT_INSTALL=1 flit install --symlink \
 && rm -rf ~/.config/pip
# LLVM requires at least CMake 3.20.0, and we need 3.24 for flang support,
# and 3.27 for fujitsu's compiler-test-suite.
# Use Cmake 3.28.6, which matches cmake in DISTRO_noble
RUN ver=3.28.6 \
 && arch=aarch64 \
 && wget https://github.com/Kitware/CMake/releases/download/v$ver/cmake-$ver-linux-$arch.sh \
 && chmod +x cmake-$ver-linux-$arch.sh \
 && ./cmake-$ver-linux-$arch.sh --prefix=/usr/local --skip-license
# Configure linux tools for benchmarking support.
#
# We symlink linux tools to supportted "hw_tags":
#   apm_32, apm_64, sq_32, sq_64, tk1_32, tx1_32, tx1_64.
# HW_TAGS represent tested configurations of hardware+kernel+perf that
# work well together.  We create new hw_tag for any variation in hardware,
# kernel, or perf.  This gives us assurance that benchmarking data stored
# under bkp-01.tcwglab:results-<HW_TAG>/ directory has no unexpected variations.
#
# For the initial hw_tags for TK1s and TX1s we can use nice short tk1_32,
# tx1_64, and tx1_32 names, but if we update, say, perf version, we would
# need to add something like tk1_32-lt_5.4 (updating linux-tools to 5.4) or
# tx1_64-k_4.10 (updating kernel to 4.10).
#
# Bionic's linux-tools-4.18 version has proven to work well with TK1s' 3.10 and
# TX1s' 4.4 kernels.  We need to install it in all distro versionss so that we
# use same perf version to generate and process results.
RUN apt-get update \
 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# cpufrequtils is used by our benchmarking scripts, but we should update them to
# use cpupower from linux-tools everywhere instead.
 cpufrequtils \
 linux-tools-generic \
 && cat /etc/apt/sources.list | sed -e "s/jammy/bionic/g" \
      > /etc/apt/sources.list.d/bionic.list \
# Import Bionic key
 && apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32 \
 && apt-get update \
 && apt-get download \
 linux-hwe-tools-4.18.0-13 \
 linux-hwe-5.4-tools-5.4.0-74 \
 linux-hwe-5.4-tools-5.4.0-80 \
 linux-hwe-5.4-tools-5.4.0-99 \
 linux-hwe-5.19-tools-5.19.0-41 \
 && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
 && rm -f /etc/apt/sources.list.d/bionic.list \
          /etc/apt/sources.list.d/bionic.sources \
          /etc/apt/sources.list.d/jammy.sources \
 && dpkg -i --force-depends \
 linux-hwe-tools-4.18.0-13*.deb \
 linux-hwe-5.4-tools-5.4.0-74*.deb \
 linux-hwe-5.4-tools-5.4.0-80*.deb \
 linux-hwe-5.4-tools-5.4.0-99*.deb \
 linux-hwe-5.19-tools-5.19.0-41*.deb \
 && rsync -aL /usr/lib/linux-hwe-tools-4.18.0-13/ /usr/lib/linux-tools/tk1_32/ \
 && cp /usr/lib/libcpupower.so.4.18.0-13 /usr/lib/linux-tools/tk1_32/ \
 && ln -s /usr/lib/linux-tools/tk1_32 /usr/lib/linux-tools/tx1_32 \
 && ln -s /usr/lib/linux-tools/tk1_32 /usr/lib/linux-tools/tx1_64 \
 && rsync -aL /usr/lib/linux-hwe-5.4-tools-5.4.0-74/ /usr/lib/linux-tools/sq_32/ \
 && cp /usr/lib/libcpupower.so.5.4.0-74 /usr/lib/linux-tools/sq_32/ \
 && ln -s /usr/lib/linux-tools/sq_32 /usr/lib/linux-tools/sq_64 \
 && rsync -aL /usr/lib/linux-hwe-5.4-tools-5.4.0-80/ /usr/lib/linux-tools/apm_32/ \
 && cp /usr/lib/libcpupower.so.5.4.0-80 /usr/lib/linux-tools/apm_32/ \
 && ln -s /usr/lib/linux-tools/apm_32 /usr/lib/linux-tools/apm_64 \
 && rsync -aL /usr/lib/linux-hwe-5.4-tools-5.4.0-99/ /usr/lib/linux-tools/fx_32/ \
 && cp /usr/lib/libcpupower.so.5.4.0-99 /usr/lib/linux-tools/fx_32/ \
 && ln -s /usr/lib/linux-tools/fx_32 /usr/lib/linux-tools/fx_64 \
 && rsync -aL /usr/lib/linux-hwe-5.19-tools-5.19.0-41/ /usr/lib/linux-tools/qc_32/ \
 && cp /usr/lib/libcpupower.so.5.19.0-41 /usr/lib/linux-tools/qc_32/ \
 && ln -s /usr/lib/linux-tools/qc_32 /usr/lib/linux-tools/qc_64 \
 && rm \
 linux-hwe-tools-4.18.0-13*.deb \
 linux-hwe-5.4-tools-5.4.0-74*.deb \
 linux-hwe-5.4-tools-5.4.0-80*.deb \
 linux-hwe-5.4-tools-5.4.0-99*.deb \
 linux-hwe-5.19-tools-5.19.0-41*.deb \
 && dpkg -r \
 linux-hwe-tools-4.18.0-13 \
 linux-hwe-5.4-tools-5.4.0-74 \
 linux-hwe-5.4-tools-5.4.0-80 \
 linux-hwe-5.4-tools-5.4.0-99 \
 linux-hwe-5.19-tools-5.19.0-41 \
 && mv -t /usr/lib/ \
 /usr/lib/linux-tools/tk1_32/libcpupower.so.4.18.0-13 \
 /usr/lib/linux-tools/sq_32/libcpupower.so.5.4.0-74 \
 /usr/lib/linux-tools/apm_32/libcpupower.so.5.4.0-80 \
 /usr/lib/linux-tools/fx_32/libcpupower.so.5.4.0-99 \
 /usr/lib/linux-tools/qc_32/libcpupower.so.5.19.0-41 \
 && true
# Add the latest clang (21.1.1)
# We need this in tcwg-llvmbot images for *-latest-clang bots, and in tcwg-build/tcwg-dev
# images for building LLVM with flang enabled. Also using x86 llvm for building and testing
# kernel, qemu, ...
RUN \
 clang_ver=LLVM-21.1.1-Linux-ARM64 \
 # For the 21.1.1 release, the two archives have different formats.
 ext=xz \
 && cd /usr/local \
 && wget --progress=dot:giga https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.1/$clang_ver.tar.$ext \
 && tar xf $clang_ver.tar.$ext \
 && rm $clang_ver.tar.$ext
# Do we need this?
# Add libpgmath, which is used by flang
RUN git clone https://github.com/rovka/libpgmath-binaries.git \
 && mv libpgmath-binaries/* /usr/local/lib/ \
 && rm -rf libpgmath-binaries
# Precommit testing for GNU projects requires autoconf-2.69 and
# automake-1.15.1.  Install them in custom paths to avoid confusing
# other tools that make use of the system versions.
# README-maintainer-mode in these projects also mentions libtool-2.2.6
# and gettext-0.16.1, but there is no tarball available for these
# versions.  In addition, some files have been regenerated using
# libtool-2.2.7a which is not available either.  Build succeeds in
# with --enable-maintainer-mode and the system versions of libtool and
# gettext, so rely on them.
RUN autoconf_version=2.69 autoconf_ver=autoconf-${autoconf_version}  \
 && cd /usr/local \
 && wget https://ftp.gnu.org/gnu/autoconf/${autoconf_ver}.tar.xz \
 && cd /tmp \
 && tar xf /usr/local/${autoconf_ver}.tar.xz \
 && cd ${autoconf_ver} \
 && mkdir build \
 && cd build \
 && ../configure --prefix=/usr/local/${autoconf_ver} \
 && make install \
 && cd /usr/local/${autoconf_ver}/bin \
 && for f in autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames; do \
      ln -sv $f $f-${autoconf_version} ; \
    done \
 && rm -f /usr/local/${autoconf_ver}.tar.xz \
 && automake_version=1.15.1 automake_ver=automake-${automake_version} \
 && cd /usr/local \
 && wget https://ftp.gnu.org/gnu/automake/${automake_ver}.tar.xz \
 && cd /tmp \
 && tar xf /usr/local/${automake_ver}.tar.xz \
 && cd ${automake_ver} \
 && mkdir build \
 && cd build \
 && ../configure --prefix=/usr/local/${automake_ver} \
 && make install \
 && cd /usr/local/${automake_ver}/bin \
 && for f in aclocal automake; do \
      ln -sv $f $f-${automake_version} ; \
    done \
 && rm -f /usr/local/${automake_ver}.tar.xz \
 && rm -rf /tmp/${autoconf_ver} /tmp/${automake_ver}
COPY home-data/ /home-data/
COPY install-gcc-latest.sh new-user.sh nvidia-power-cycle.sh nvidia-serial.sh \
  /usr/local/bin/
RUN \
 while read line; do \
   new-user.sh --group $(echo "$line" | cut -d: -f 1,3); \
 done < <(grep -v ":x:x:" /home-data/group)
# Create directories required for X11.  We use X11 in tcwg-x2go images and,
# sometimes, in tcwg-dev images.
# We need to create these before "VOLUME /tmp" directive, since after
# the directive stuff from /tmp won't make it into the image.
RUN mkdir -p /tmp/.X11-unix /tmp/.ICE-unix \
 && chmod 1777 /tmp/.X11-unix /tmp/.ICE-unix
# We use ssh multiplexing, which creates sockets in /tmp.  Overlayfs,
# which docker is using, can't host sockets, so we use a scratch mount
# for /tmp.  This requires that we add --rm option to "docker run"
# invocations (e.g., mark "Remove volumes" checkbox in docker plugin) to
# cleanup host directories used for the scratch mounts.
VOLUME /tmp
# checksum: 2048d4b4bdb8c6b302ba8486eb6ece45
