# Create a Docker image that is ready to run the full Daikon tests,
# including building the manual and Javadoc.
# But it's used primarily for running miscellaneous tests such as the manual
# and Javadoc.

# "ubuntu" is the latest LTS release.  "ubuntu:rolling" is the latest release.
# Either might lag behind; as of 2024-11-16, ubuntu:rolling was still 24.04 rather than 24.10.
FROM ubuntu:oracular
LABEL org.opencontainers.image.authors="Michael Ernst <mernst@cs.washington.edu>"

# According to
# https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/:
#  * Put "apt-get update" and "apt-get install" in the same RUN command.
#  * Do not run "apt-get upgrade"; instead get upstream to update.

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& apt-get install -y locales \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen "en_US.UTF-8"
ENV LANG=en_US.UTF-8 \
    LANGUAGE=en_US:en \
    LC_ALL=en_US.UTF-8

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& apt-get -qqy install \
  apt-utils

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& apt-get -qqy install \
  autoconf \
  automake \
  bc \
  binutils-dev \
  gcc \
  git \
  jq \
  lsb-release \
  m4 \
  make \
  rsync \
  unzip

# Install the JDK.
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& apt-get -qqy install \
  openjdk-21-jdk \
&& update-java-alternatives --set java-1.21.0-openjdk-amd64

# These are needed to build the Checker Framework, used by the "typecheck" job in CI.
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& apt-get -qqy install \
  ant \
  maven \
  python3

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& apt-get -qqy install \
  curl \
  devscripts \
  g++ \
  graphviz \
  libc6-dbg \
  netpbm \
  pip \
  python3-setuptools \
  shellcheck \
  shfmt \
  texinfo \
  texlive \
  texlive-latex-extra \
  universal-ctags \
  wget \
  zlib1g-dev

RUN export DEBIAN_FRONTEND=noninteractive \
&& pip install ruff --break-system-packages

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
