# Use the Ubuntu 24.04 base image
FROM ubuntu:24.04

# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive

# Update apt and install the requested packages
# (Note: make and gcc are technically included in build-essential, but added explicitly)
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    ca-certificates \
    build-essential \
    git \
    python3 \
    make \
    gcc \
    nano \ 
    file \
    default-jre \
    libjson-perl \
    rdfind \
    libparse-yapp-perl \
    gperf \
    xsltproc \
    libncurses5-dev \
    xfonts-utils \
    gawk \
    zstd \
    unzip \
    libxml-parser-perl \
    wget \
    zip \
    patchutils \
    bc \
    lzop && \
    rm -rf /var/lib/apt/lists/*

# The default 'ubuntu' user already has UID 1000.
# We change its primary group to GID 100 ('users') 
# and update the home directory's group ownership to match.
RUN usermod -g 100 ubuntu && \
    chown -R ubuntu:100 /home/ubuntu

# Switch to the new user and set the working directory
USER ubuntu
WORKDIR /home/ubuntu

# # Clone the CoreELEC repository into the working directory
# RUN git clone https://github.com/CoreELEC/CoreELEC.git

# Start the container in bash
CMD ["/bin/bash"]
