# Start with the base AlmaLinux 9.4 image
FROM almalinux:9.4

# Remove existing repos and copy custom repo files into the container
RUN rm -rf /etc/yum.repos.d/*.repo

# Copy from the local context into the container
COPY files/*.repo /etc/yum.repos.d/

# Install ca-certs
RUN curl -k -o internal-ca-certificates.rpm https://git.query.consul/unkin/-/packages/rpm/internal-ca-certificates/20240825-1.el8/files/756 && \
    rpm -i internal-ca-certificates.rpm

# Clean and update the repository cache
RUN dnf clean all && \
    dnf makecache

# Update the system and install required packages
RUN dnf update -y && \
    dnf install -y curl-minimal git

# Cleanup
RUN dnf clean all && \
    rm -rf /var/cache/dnf
