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

FROM rockylinux:9
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 dnf -q -y upgrade && dnf -q -y install \
  autoconf \
  automake \
  bc \
  binutils-devel \
  diffutils \
  findutils \
  gcc \
  git \
  m4 \
  make \
  perl-English \
  perl-filetest \
  rsync \
  tar \
  unzip \
  which

# Install the JDK.
# Packages java-24-openjdk* don't yet exist as of 2025-04-28.
# RUN dnf -q -y install \
#   java-24-openjdk \
#   java-24-openjdk-devel

RUN curl --silent -o jdk-24_linux-x64_bin.tar.gz https://download.oracle.com/java/24/latest/jdk-24_linux-x64_bin.tar.gz \
&& tar xzf jdk-24_linux-x64_bin.tar.gz
ENV PATH="/jdk-24.0.1/bin:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

RUN chmod og+rx /root \
&& chmod og+r /root/*

# This enables the repository that contains jq
RUN dnf -q -y install \
  epel-release

RUN dnf -q -y install \
  jq

RUN dnf -q clean all
