# Create a Docker image that is ready to run the Daikon tests.

# "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:rolling
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 update" and "apt install" in the same RUN command.
#  * Do not run "apt upgrade"; instead get upstream to update.

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt -qqy update \
&& apt -qqy install 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 -qqy update \
&& apt -qqy install \
  apt-utils

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

# Install the JDK.
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt -qqy update \
&& apt -qqy install \
  openjdk-25-jdk \
&& update-java-alternatives --set java-1.25.0-openjdk-amd64
ENV JAVA25_HOME=/usr/lib/jvm/java-25-openjdk-amd64

# Clean up.
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt -qqy autoremove \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
