#if ARCH_armhf
FROM arm32v7/ubuntu:#{DISTRO}
#else
FROM ubuntu:#{DISTRO}
#endif

# 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 \
#if !DISTRO_focal && !DISTRO_jammy
 && DEBIAN_FRONTEND=noninteractive apt-get install -y unminimize \
#endif
 && echo y | unminimize \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 && DEBIAN_FRONTEND=noninteractive apt-get install -y devscripts \
#endif
 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 alien \
#endif
 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 \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 bsd-mailx \
#endif
#if !DISTRO_focal
# bsdextrautils need to be explicitely installed on noble.
# Useful at least for hexdump on tcwg_kernel CI projects.
 bsdextrautils \
#endif
 build-essential \
 byacc \
 ccache \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 ccrypt \
 chrpath \
#endif
 clang \
#if !(DISTRO_focal || DISTRO_jammy)
# We install recent cmake for focal and jammy below.
 cmake \
#endif
# We need cpio for linux kernel builds.
 cpio \
 curl \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 debhelper \
#endif
 default-jre \
 dejagnu \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 dh-autoreconf \
 dh-translations \
 distro-info-data \
#endif
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 fakeroot \
#endif
 flex \
# fp-compiler enables more GDB tests.
 fp-compiler \
 gawk \
#if DISTRO_noble
# Noble uses gcc-13 as default version, but some packages already depend on
# gcc-14.  E.g., emacs depends on libgccjit0 (gcc-14 version), which depends
# on libgcc-14-dev.  The issue arrises with our custom clang++ builds: clang++
# sees both [complete] gcc-13 and [incomplete] gcc-14 sysroots, and picks
# gcc-14 sysroot for headers.  Therefore, we need a complete gcc-14/g++-14
# setup for our clang++ builds to work.
 gcc-14 \
 g++-14 \
#endif
# gdc is used by GDB testsuite.
 gdc \
 gdb \
 gdbserver \
# gettext is needed according to README-maintainer-mode
 gettext \
 gfortran \
 git \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 # git-annex : is now used to store bmk results in base-artifacts
 git-annex \
#endif
#if !DISTRO_focal
 git-filter-repo \
#endif
# gm2 is used by GDB testsuite.
 gm2 \
#if DISTRO_jammy
 # For unknown reason "gnat" defaults to "gnat-10" in Jammy, while all other
 # GCC packages default to "*-11" versions.
 gnat-11 \
#else
 gnat \
#endif
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 gobjc \
 gobjc++ \
 golang \
 groff \
#endif
 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 \
#if DISTRO_focal || DISTRO_jammy
# Our bionic-built llvm releases expect to find this but
# focal installs libtinfo6 instead.
 libtinfo5 \
#endif
 libtool \
# For building lldb.
 libxml2-dev \
 llvm \
 locales \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 lzop \
#endif
 make \
# Used GCC to build GCobol documentation.
 mandoc \
#if ARCH_amd64
 mingw-w64 \
#endif
 moreutils \
 net-tools \
 netcat-openbsd \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
# NFS server is used in start-container-qemu.sh, which we don't use anymore.
 nfs-kernel-server \
#endif
 ninja-build \
 ntp \
 openssh-server \
 pkg-config \
#if ARCH_amd64
# needed for lnt server
 postgresql \
#endif
# 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 \
#if !DISTRO_focal
# 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 \
#endif
 rsync \
# sqlite3 is used by lnt test suite
 sqlite3 \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 subversion \
#endif
 sudo \
 swig \
# systemtap-sdt-dev allows building glibc with probes, which GDB uses to
# detect shared library events.
 systemtap-sdt-dev \
#if DISTRO_focal || DISTRO_jammy
# Do we need this?
 tclsh \
#endif
 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

#if DISTRO_focal || DISTRO_jammy
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 \
# if !ARCH_armhf
# tomli package to build qemu
 && pip3 install tomli \
# endif
# For testing lldb.
 && pip3 install pexpect \
# if ARCH_amd64
# tensorflow package required to enable MLGO in clang builds (for AOSP toolchains)
# installation of this package fails on arm64/focal
 && pip3 install 'tensorflow==2.13.1' \
# endif
# Required for qemu build meson > 1.5.0
 && pip3 install meson \
 && true
#else
RUN apt-get update \
 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
 git-review \
 python3-psutil \
# flit is used to install jipdate below.
 flit \
# if !ARCH_armhf
# tomli package to build qemu
 python3-tomli \
# endif
# For testing lldb.
 python3-pexpect \
 && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# if DISTRO_noble
# Handle python packages, which don't have Debian packages yet.
RUN true \
# 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 --break-system-packages git-pw shyaml \
# Forgejo client for pre-commit testing, used in
# jenkins-scripts/precommit-forge-*.sh and jenkins-scripts/forgejo-report.py
 && pip3 install --break-system-packages pyforgejo \
#  if ARCH_amd64
# tensorflow package required to enable MLGO in clang builds (for AOSP
# toolchains) installation of this package fails on arm64/focal
 && pip3 install --break-system-packages 'tensorflow==2.17.1' \
#  endif
# Required for qemu build meson > 1.5.0; noble has "meson" 1.3 package.
 && pip3 install --break-system-packages meson \
 && true
# else
# Re-evaluate state of shyaml, tensorflow, meson and jipdate for the next LTS.
RUN false
# endif
#endif

# 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
#if DISTRO_focal || DISTRO_jammy
RUN ver=3.28.6 \
# if ARCH_arm64 || ARCH_amd64
#  if ARCH_arm64
 && arch=aarch64 \
#  else
 && arch=x86_64 \
#  endif
 && 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
# else
  && cd /tmp \
  && git clone -b v$ver --single-branch --depth 1 https://github.com/Kitware/CMake.git \
  && cd /tmp/CMake \
  && ./bootstrap --parallel=$(nproc --all) \
  && make -j$(nproc --all) \
  && make -j$(nproc --all) install \
  && cd /tmp \
  && rm -rf /tmp/CMake
# endif
#endif

# 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 \
#if DISTRO_focal || DISTRO_jammy
 && cat /etc/apt/sources.list | sed -e "s/#{DISTRO}/bionic/g" \
      > /etc/apt/sources.list.d/bionic.list \
#else
 && cat /etc/apt/sources.list.d/ubuntu.sources | sed -e "s/#{DISTRO}/bionic/g" \
      > /etc/apt/sources.list.d/bionic.sources \
 && cat /etc/apt/sources.list.d/ubuntu.sources | sed -e "s/#{DISTRO}/jammy/g" \
      > /etc/apt/sources.list.d/jammy.sources \
#endif
# 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 \
#if !DISTRO_focal
 linux-hwe-5.19-tools-5.19.0-41 \
#endif
 && 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 \
#if !DISTRO_focal
 linux-hwe-5.19-tools-5.19.0-41*.deb \
#endif
 && 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 \
#if !DISTRO_focal
 && 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 \
#endif
 && 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 \
#if !DISTRO_focal
 linux-hwe-5.19-tools-5.19.0-41*.deb \
#endif
 && 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 \
#if !DISTRO_focal
 linux-hwe-5.19-tools-5.19.0-41 \
#endif
 && 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 \
#if !DISTRO_focal
 /usr/lib/linux-tools/qc_32/libcpupower.so.5.19.0-41 \
#endif
 && true

#if ARCH_armhf
COPY install-armhf-perf-workaround.sh /usr/lib/linux-tools/
#endif

#if ARCH_amd64
# Install usb libs and OpenOCD on x86 hosts, used to target bare-metal boards.
RUN apt-get update \
 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
 libusb-1.0 \
 libusb-dev \
 && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cd /tmp \
 && git clone --single-branch https://git.code.sf.net/p/openocd/code openocd \
 && cd /tmp/openocd \
# Next commit (ce5027ab019ac7f96d05ec5f8f533144b3bcafdf) breaks semihosting.
# See https://review.openocd.org/c/openocd/+/6888 .
 && git checkout e5f515f990cc345fd3089a5520f39d5a128329bd \
 && ./bootstrap \
 && ./configure --enable-stlink \
 && make -j$(nproc --all) \
 && make -j$(nproc --all) install \
 && cd /tmp \
 && rm -rf /tmp/openocd
#endif

# 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 \
#if ARCH_arm64
 clang_ver=LLVM-21.1.1-Linux-ARM64 \
 # For the 21.1.1 release, the two archives have different formats.
 ext=xz \
#elif ARCH_amd64
 clang_ver=LLVM-21.1.1-Linux-X64 \
 ext=xz \
#else /* ARCH_armhf */
 clang_ver=clang+llvm-21.1.1-armv7a-linux-gnueabihf \
 ext=gz \
#endif
 && 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

#if DISTRO_focal || DISTRO_jammy
#if ARCH_arm64
# 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
#endif
#endif

#if DISTRO_focal
# Install git-filter-repo for Ubuntu Focal
RUN curl -f -o $(git --exec-path)/git-filter-repo \
  https://raw.githubusercontent.com/newren/git-filter-repo/main/git-filter-repo \
  && chmod +x $(git --exec-path)/git-filter-repo
#endif

# 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

#if ARCH_armhf
# For AArch32 images, add a warning if an interactive shell is opened in an
# AArch64 environment.
RUN echo $'if [ "$(uname -m)" == "aarch64" ] || [ "$(uname -m)" == "x86_64" ]; then\n' \
         $'  echo "============================================================================================="\n' \
         $'  echo "WARNING: This is a 32-bit container, but your shell is running in a 64-bit environment."\n' \
         $'  echo "You probably want to run your shell with the \'linux32\' program to get a 32-bit environment."\n' \
         $'  echo "============================================================================================="\n' \
         $'fi\n' \
         >> /etc/bash.bashrc
#endif

# 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
